DthingApi
|
Public Member Functions | |
ByteArrayInputStream (byte[] buf) | |
ByteArrayInputStream (byte[] buf, int offset, int length) | |
synchronized int | available () |
void | close () throws IOException |
synchronized void | mark (int readlimit) |
boolean | markSupported () |
synchronized int | read () |
synchronized int | read (byte[] buffer, int offset, int length) |
synchronized long | skip (long byteCount) |
synchronized void | reset () throws IOException |
![]() | |
InputStream () | |
int | available () throws IOException |
void | close () throws IOException |
void | mark (int readlimit) |
boolean | markSupported () |
abstract int | read () throws IOException |
int | read (byte[] buffer) throws IOException |
int | read (byte[] buffer, int offset, int length) throws IOException |
synchronized void | reset () throws IOException |
long | skip (long byteCount) throws IOException |
Protected Attributes | |
byte [] | buf |
int | pos |
int | mark |
int | count |
A specialized InputStream for reading the contents of a byte array.
|
inline |
Constructs a new
on the byte array
.
buf | the byte array to stream over. |
|
inline |
Constructs a new
on the byte array
with the initial position set to
and the number of bytes available set to
+
.
buf | the byte array to stream over. |
offset | the initial position in to start streaming from. |
length | the number of bytes available for streaming. |
|
inline |
|
inline |
Closes this stream and frees resources associated with this stream.
IOException | if an I/O error occurs while closing this stream. |
|
inline |
Sets a mark position in this ByteArrayInputStream. The parameter
is ignored. Sending
will reposition the stream back to the marked position.
readlimit | ignored. |
|
inline |
|
inline |
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.
|
inline |
Reads at most
bytes from this stream and stores them in byte array
starting at
. This implementation reads bytes from the source byte array.
buffer | the byte array in which to store the bytes read. |
offset | the initial position in b |
length | the maximum number of bytes to store in b |
IndexOutOfBoundsException | if offset < 0 length < 0 offset + length b |
NullPointerException | if b null |
|
inline |
Resets this stream to the last marked location. Throws an
if the number of bytes read since the mark has been set is greater than the limit provided to
, or if no mark has been set.
This implementation always throws an
and concrete subclasses should provide the proper implementation.
IOException | if this stream is closed or another IOException occurs. |
|
inline |
Skips
bytes in this InputStream. Subsequent calls to
will not return these bytes unless
is used. This implementation skips
number of bytes in the target stream. It does nothing and returns 0 if
is negative.
|
protected |
The
array containing the bytes to stream over.
|
protected |
|
protected |
The current mark position. Initially set to 0 or the offset
parameter within the constructor.
|
protected |
The current position within the byte array.