PushbackInputStream mark() method in Java with Examples
The mark() method of PushbackInputStream class in Java is used to mark the current position in the input stream. This method does nothing for PushbackInputStream.
public void mark(int readlimit)
Overrides: This method overrides the mark() method of FilterInputStream class.
Parameters: This method accepts single parameter readlimit that represents the the maximum limit of bytes that can be read before the mark position becomes invalid.
Return value: This method does not return any value.
Exceptions: This method does not throw any exception.
Below programs illustrate mark() method of PushbackInputStream class in IO package:
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. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.