PushbackReader markSupported() method in Java with Examples Last Updated : 29 Apr, 2019 Comments Improve Suggest changes Like Article Like Report The markSupported() method of PushbackReader Class in Java is used to check whether this PushbackReader is supports mark() operation or not. It returns a boolean which states if the reader is mark supported. Syntax: public boolean markSupported() Parameters: This method does not accepts any parameters Return Value: This method returns a boolean value which tells if this PushbackReader supports mark() operation or not. It return true if it is markSupported. Else it returns false. Below methods illustrates the working of markSupported() method: Program 1: Java // Java program to demonstrate // PushbackReader markSupported() method import java.io.*; import java.util.*; class GFG { public static void main(String[] args) { try { // Initializing a StringReader // and PushbackReader String s = "GeeksForGeeks"; StringReader stringReader = new StringReader(s); PushbackReader pushbackReader = new PushbackReader(stringReader); // check if the mark() method // is supported or not System.out.println("Is mark() supported:" + pushbackReader.markSupported()); // Close the stream using markSupported() pushbackReader.close(); System.out.println("Stream Closed."); } catch (Exception e) { System.out.println(e); } } } Output: Is mark() supported:false Stream Closed. Program 2: Java // Java program to demonstrate // PushbackReader markSupported() method import java.io.*; import java.util.*; class GFG { public static void main(String[] args) { try { // Initializing a StringReader // and PushbackReader String s = "GFG"; StringReader stringReader = new StringReader(s); PushbackReader pushbackReader = new PushbackReader(stringReader); // check if the mark() method // is supported or not System.out.println("Is mark() supported:" + pushbackReader.markSupported()); // Close the stream pushbackReader.close(); System.out.println("Stream Closed."); } catch (Exception e) { System.out.println(e); } } } Output: Is mark() supported:false Stream Closed. Reference: https://docs.oracle.com/javase/9/docs/api/java/io/PushbackReader.html#markSupported-- Comment More infoAdvertise with us Next Article PushbackReader markSupported() method in Java with Examples S srinam Follow Improve Article Tags : Java Java-Functions Java-IO package Java-PushbackReader Practice Tags : Java Similar Reads Reader markSupported() method in Java with Examples The markSupported() method of Reader Class in Java is used to check whether this Reader is supports mark() operation or not. It returns a boolean which states if the reader is mark supported. Syntax: public boolean markSupported() Parameters: This method does not accepts any parameters Return Value: 2 min read PushbackInputStream markSupported() method in Java with Examples The markSupported() method of PushbackInputStream class in Java is used to verify the supportability of mark() and reset() methods. It always returns false as this class does not support mark() and reset(). Syntax: public boolean markSupported() Overrides: This method overrides the markSupported() m 2 min read StringReader markSupported() method in Java with Examples The markSupported() method of StringReader Class in Java is used to check whether this StringReader is supports mark() operation or not. It returns a boolean which states if the reader is mark supported. Syntax: public boolean markSupported() Parameters: This method does not accepts any parameters R 2 min read PushbackReader mark(int) method in Java with Examples The mark() method of PushbackReader Class in Java is used to marks the current position of the PushbackReader. In the case of PushbackReader, this method always throws an exception as this method isn't supported by the PushbackReader. Syntax: public void mark(int readAheadLimit) Parameters: This met 2 min read 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. Syntax: public void mark(int readlimit) Overrides: This method overrides the mark() method of FilterInputStream class. Parameters: This m 2 min read PushbackReader read() method in Java with Examples The read() method of PushbackReader Class in Java is used to read a single character from the stream. This method blocks the stream till: It has taken some input from the stream. Some IOException has occurred It has reached the end of the stream while reading. Syntax: public int read() Parameters: T 3 min read PushbackReader skip(long) method in Java with Examples The skip(long) method of PushbackReader Class in Java is used to skip the specified number of characters on the stream. This number of characters is specified as the parameter. If it reaches the end of the stream by skipping, it will block the stream until it gets some characters, or throw IOExcepti 3 min read PushbackReader ready() method in Java with Examples The ready() method of PushbackReader Class in Java is used to check whether this PushbackReader is ready to be read or not. It returns a boolean which states if the reader is ready. Syntax: public void ready() Parameters: This method does not accepts any parameters Return Value: This method returns 2 min read PushbackReader reset() method in Java with Examples The reset() method of PushbackReader Class in Java is used to reset the Stream. In the case of PushbackReader, this method always throws an exception as this method isn't supported by the PushbackReader. Syntax: public void reset() Parameters: This method do not accepts any parameter. Return Value: 2 min read PushbackReader close() method in Java with Examples The close() method of PushbackReader Class in Java is used to close the stream and release the resources that were busy in the stream, if any. This method has following results: If the stream is open, it closes the stream releasing the resources If the stream is already closed, it will have no effec 2 min read Like