Code example for PushbackInputStream

Methods: readskipunread

0
	 * @tests java.io.PushbackInputStream#skip(long) 
	 */ 
	public void test_skipJ() throws Exception { 
		// Test for method long java.io.PushbackInputStream.skip(long) 
                byte[] buf = new byte[50];
                pis.skip(50);
                pis.read(buf, 0, buf.length);
                assertTrue("a) Incorrect bytes read", new String(buf, "UTF-8")
                                .equals(fileString.substring(50, 100)));
                pis.unread(buf);
                pis.skip(25);
                byte[] buf2 = new byte[25];
                pis.read(buf2, 0, buf2.length);
                assertTrue("b) Incorrect bytes read", new String(buf2, "UTF-8")
                                .equals(fileString.substring(75, 100)));
	} 
 
	/** 
	 * @tests java.io.PushbackInputStream#unread(byte[]) 
	 */ 
Connect your IDE to all the code out there  Get Codota for Java