The skip() method is a built-in method of the Java.io.ByteArrayInputStream which skips arg bytes in the input stream. A fewer bytes is skipped if the stream has reached towards the end.
public long skip(long args)
Parameters: The function accepts a single mandatory parameter args which specifies the number of bytes to be skipped
Return Value: The function returns the number of skip bytes.
Errors an Exceptions: The function throws an IOException when I/O error occurs.
Below is the implementation of the above function:
5 7 8
1 5 6
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.