Menu Bar

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Thursday, 11 May 2017

What is ByteArrayInputStream Class In Java ?

Class ByteArrayInputStream

All Implemented Interfaces:
Closeable, AutoCloseable

Declaration of ByteArrayInputStream:
public class ByteArrayInputStream
extends InputStream

A ByteArrayInputStream contains an internal buffer that contains bytes that may be read from the stream. An internal counter keeps track of the next byte to be supplied by the read method.
Closing a ByteArrayInputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

Constructor Summary of ByteArrayInputStream :

Constructor
Description
ByteArrayInputStream(byte[] buf)
Creates a ByteArrayInputStream so that it uses buf as its buffer array.
ByteArrayInputStream(byte[] buf, int offset, int length)
Creates ByteArrayInputStream that uses buf as its buffer array.

Method Summary of ByteArrayInputStream :

Modifier and Method Name
Description
int available()
Returns the number of remaining bytes that can be read (or skipped over) from this input stream.
void close()
Closing a ByteArrayInputStream has no effect.
void mark(int readAheadLimit)
Set the current marked position in the stream.
boolean markSupported()
Tests if this InputStream supports mark/reset.
int read()
Reads the next byte of data from this input stream.
int read(byte[] b, int off, int len)
Reads up to len bytes of data into an array of bytes from this input stream.
void reset()
Resets the buffer to the marked position.
long skip(long n)
Skips n bytes of input from this input stream.

      
Blog Author - Pushkar Khosla,
Software Developer by Profession with 3.0 Yrs of Experience , through this blog i'am sharing my industrial Java Knowledge to entire world. For any question or query any one can comment below or mail me at pushkar.itsitm52@gmail.com.

Share this Blog with yours Friends !!

No comments:

Post a Comment