| java.lang.Object | ||
| ↳ | java.io.InputStream | |
| ↳ | java.io.ByteArrayInputStream | |
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| buf | The bytearray containing the bytes to stream over. | ||||||||||
| count | The total number of bytes initially available in the byte array buf. | ||||||||||
| mark | The current mark position. | ||||||||||
| pos | The current position within the byte array. | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Constructs a new  ByteArrayInputStreamon the byte arraybuf. | |||||||||||
| Constructs a new  ByteArrayInputStreamon the byte arraybufwith the initial position set tooffsetand the
 number of bytes available set tooffset+length. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns the number of remaining bytes. | |||||||||||
| Closes this stream and frees resources associated with this stream. | |||||||||||
| Sets a mark position in this ByteArrayInputStream. | |||||||||||
| Indicates whether this stream supports the  mark()andreset()methods. | |||||||||||
| Reads a single byte from the source byte array and returns it as an
 integer in the range from 0 to 255. | |||||||||||
| Reads up to  byteCountbytes from this stream and stores them in
 the byte arraybufferstarting atbyteOffset. | |||||||||||
| Resets this stream to the last marked location. | |||||||||||
| Skips  byteCountbytes in this InputStream. | |||||||||||
| [Expand] Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class
  java.io.InputStream | |||||||||||
|  From class
  java.lang.Object | |||||||||||
|  From interface
  java.io.Closeable | |||||||||||
|  From interface
  java.lang.AutoCloseable | |||||||||||
The total number of bytes initially available in the byte array
 buf.
The current mark position. Initially set to 0 or the offset
 parameter within the constructor.
Constructs a new ByteArrayInputStream on the byte array
 buf.
| buf | the byte array to stream over. | 
|---|
Constructs a new ByteArrayInputStream on the byte array
 buf with the initial position set to offset and the
 number of bytes available set to offset + length.
| buf | the byte array to stream over. | 
|---|---|
| offset | the initial position in bufto start streaming from. | 
| length | the number of bytes available for streaming. | 
Returns the number of remaining bytes.
count - pos
Closes this stream and frees resources associated with this stream.
| IOException | if an I/O error occurs while closing this stream. | 
|---|
Sets a mark position in this ByteArrayInputStream. The parameter
 readlimit is ignored. Sending reset() will reposition the
 stream back to the marked position.
| readlimit | ignored. | 
|---|
Reads a single byte from the source byte array and returns it as an integer in the range from 0 to 255. Returns -1 if the end of the source array has been reached.
Reads up to byteCount bytes from this stream and stores them in
 the byte array buffer starting at byteOffset.
 Returns the number of bytes actually read or -1 if the end of the stream
 has been reached.
Resets this stream to the last marked location. This implementation resets the position to either the marked position, the start position supplied in the constructor or 0 if neither has been provided.
Skips byteCount bytes in this InputStream. Subsequent
 calls to read will not return these bytes unless reset is
 used. This implementation skips byteCount number of bytes in the
 target stream. It does nothing and returns 0 if byteCount is negative.