|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.io.InputStream jcontrol.io.ByteArrayInputStream
public class ByteArrayInputStream
The ByteArrayOutputStream
allows to access a byte array as an InputStream
.
An internal read pointer is increased on read accesses.
Field Summary | |
---|---|
protected byte[] |
m_array
Underlying byte array. |
protected int |
m_readPos
Internal read pointer. |
Constructor Summary | |
---|---|
ByteArrayInputStream(byte[] array)
Creates a new ByteArrayInputStream for the specified byte array. |
Method Summary | |
---|---|
int |
available()
Returns the number of bytes immediately available for reading from this stream. |
void |
close()
Has no effect on the ByteArrayInputStream . |
void |
mark(int readlimit)
Currently not supported. |
boolean |
markSupported()
Currently not supported. |
int |
read()
Reads a single byte from the stream. |
void |
read(byte[] b,
int start,
int length)
Reads an array of bytes from the stream. |
void |
reset()
Currently not supported. |
void |
skip(int length)
Skips data from the stream. |
Methods inherited from class jcontrol.io.InputStream |
---|
read |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Field Detail |
---|
protected byte[] m_array
protected int m_readPos
Constructor Detail |
---|
public ByteArrayInputStream(byte[] array)
ByteArrayInputStream
for the specified byte array.
array
- byte array to read fromMethod Detail |
---|
public int available()
InputStream
available
in class InputStream
public void close() throws IOException
ByteArrayInputStream
.
close
in class InputStream
IOException
- if stream is already closedpublic void mark(int readlimit)
mark
in class InputStream
public boolean markSupported()
markSupported
in class InputStream
public int read()
InputStream
read
in class InputStream
public void read(byte[] b, int start, int length)
InputStream
read
in class InputStream
b
- array where data is storedstart
- offset within the data arraylength
- number of bytes to readpublic void reset()
reset
in class InputStream
public void skip(int length)
InputStream
skip
in class InputStream
length
- number of bytes to skip
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |