Examples of peekByte()


Examples of org.apache.jena.atlas.io.PeekInputStream.peekByte()

    @Test public void unread1()
    {
        PeekInputStream in = make("abc") ;
        assertEquals('a', in.peekByte()) ;
        in.pushbackByte('Z') ;
        assertEquals('Z', in.peekByte()) ;
        contains(in, "Zabc") ;
    }

    @Test public void unread2()
    {
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekInputStream.peekByte()

        PeekInputStream in = make("abc") ;
        checkLineCol(in, INIT_LINE, INIT_COL) ;
        int ch = in.readByte() ;
        // Pushback does not move line/col backwards.
        checkLineCol(in, INIT_LINE, INIT_COL+1) ;
        assertEquals('b', in.peekByte()) ;
        checkLineCol(in, INIT_LINE, INIT_COL+1) ;
        in.pushbackByte('a') ;
        checkLineCol(in, INIT_LINE, INIT_COL+1) ;
        contains(in, "abc") ;
    }
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekInputStream.peekByte()

   
    @Test public void unread3()
    {
        PeekInputStream in = make("") ;
        int ch = in.readByte() ;
        assertEquals(-1, in.peekByte()) ;
        in.pushbackByte('a') ;
        contains(in, "a") ;
    }

    @Test public void unread4()
View Full Code Here

Examples of org.apache.jena.atlas.io.PeekInputStream.peekByte()

    @Test public void unread4()
    {
        PeekInputStream in = make("") ;
        int ch = in.readByte() ;
        assertEquals(-1, in.peekByte()) ;
        in.pushbackByte('0') ;
        in.pushbackByte('1') ;
        in.pushbackByte('2') ;
        in.pushbackByte('3') ;
        contains(in, "3210") ;   // Backwards!
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.