PushbackInputStream skip() method in Java with Examples
The skip(long n) method of PushbackInputStream class in Java is used to skip over and discards n bytes of data from this input stream. This method first skips over the bytes in the pushback buffer, and then calls the skip method of the main input stream. It returns the actual number of bytes skipped.
public long skip(long n) throws IOException
Overrides: This method overrides the skip() method of FilterInputStream class.
Parameters: This method accepts one parameter n which represents the number of bytes to be skipped.
Return value: This method returns the actual number of bytes skipped.
Exceptions: This method throws IOException if the stream has been closed by calling close() method or if an I/O error occurs.
Below programs illustrate skip(long) method of PushbackInputStream class in IO package:
Please Login to comment...