Java.io.PushbackInputStream.unread() Method

Description

The java.io.PushbackInputStream.unread(byte[] b,int off,int len) method pushes back a portion of an array of bytes by copying it to the front of the pushback buffer. After this method returns, the next byte to be read will have the value b[off], the byte after that will have the value b[off+1], and so forth.

Declaration

Following is the declaration for java.io.PushbackInputStream.unread() method.

public void unread(byte[] b,int off,int len)

Parameters

b -- the byte array to push back.

off -- the start offset of the data.

len -- the number of bytes to push back.

Return Value

This method does not return a value.

Exception

IOException -- If there is not enough room in the pushback buffer for the specified number of bytes, or this input stream has been closed by invoking its close() method.

Example

The following example shows the usage of java.io.PushbackInputStream.unread() method.