Java BufferedInputStream markSupported() Example

BufferedInputStream class markSupported() method example. This example shows you how to use markSupported() method.


Syntax is :public boolean markSupported()
This method tests if this input stream supports the mark and reset methods. The markSupported method of BufferedInputStream returns true. Method returns a boolean true or false indicating if this stream type supports the mark and reset methods.

Here is the code.
/**
 * @(#) MarkSupportedBufferedInputStream.java
 * A class representing use of method markSupported(() of BufferedInputStream class in 
 java.io Package.
 * @Version  03-May-2008
 @author   Rose India Team
 */
import java.io.*;
public class MarkSupportedBufferedInputStream {
     public static void main(String[] argsthrows IOException {
       
       /* Construct an buffer input stream using some String value.
      This is deprecated method in java api 1.6. */
        StringBufferInputStream obj = new StringBufferInputStream("MAHENDRA")

    // Construct the buffer using the buffer input stream obj.
        BufferedInputStream bin = new BufferedInputStream(obj);

         // markSupported() method call.
         boolean bool = bin.markSupported();
     System.out.println("This stream type supports the mark and reset "
     +"methods........" + bool);
    
}

Output of the program.
This stream type supports the mark and reset methods........true

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US