BufferedInputStream markSupported() in Java

markSupported(): This method is available in java.io.BufferedInputStream class of Java.

Syntax: 

boolean java.io.BufferedInputStream.markSupported()

This method tests if this input stream supports the mark and reset methods.

Note: The markSupportedmethod of BufferedInputStream returns true.

Parameters: NA

Returns: a boolean indicating if this stream type supports the mark and reset methods.

Exceptions: NA

Approach

Java

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;

public class BufferedInputStreammarkSupported {
    public static void main(String[] args) throws IOException {

        InputStream inputStream = InputStream.nullInputStream();
        BufferedInputStream bufferedInputStream =
new BufferedInputStream(inputStream);

        System.out.println(bufferedInputStream.markSupported());
    }
}

Output:

true


No comments:

Post a Comment