|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
it.unimi.dsi.mg4j.io.FastByteArrayInputStream
Simple, fast and repositionable byte-array input stream.
Field Summary | |
byte[] |
array
The array backing the input stream. |
int |
length
The number of valid bytes in array starting from offset . |
int |
offset
The first valid entry. |
Constructor Summary | |
FastByteArrayInputStream(byte[] array)
Creates a new array input stream using a given array. |
|
FastByteArrayInputStream(byte[] array,
int offset,
int length)
Creates a new array input stream using a given array fragment. |
Method Summary | |
int |
available()
|
void |
close()
Closing a fast byte array input stream has no effect. |
void |
mark(int dummy)
|
boolean |
markSupported()
|
long |
position()
Returns the current stream position. |
void |
position(long newPosition)
Sets the current stream position. |
int |
read()
|
int |
read(byte[] b,
int offset,
int length)
|
void |
reset()
|
long |
skip(long n)
|
Methods inherited from class java.io.InputStream |
read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public byte[] array
public int offset
public int length
array
starting from offset
.
Constructor Detail |
public FastByteArrayInputStream(byte[] array, int offset, int length)
array
- the backing array.offset
- the first valid entry of the array.length
- the number of valid bytes.public FastByteArrayInputStream(byte[] array)
array
- the backing array.Method Detail |
public boolean markSupported()
public void reset()
public void close()
public void mark(int dummy)
public int available()
public long skip(long n)
public int read()
public int read(byte[] b, int offset, int length)
public long position()
RepositionableStream
position
in interface RepositionableStream
public void position(long newPosition)
RepositionableStream
position
in interface RepositionableStream
newPosition
- the new stream position.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |