com.vladium.util
Class ByteArrayIStream
java.lang.Object
java.io.InputStream
com.vladium.util.ByteArrayIStream
- All Implemented Interfaces:
- java.io.Closeable
public final class ByteArrayIStream
- extends java.io.InputStream
An unsynchronized version of java.io.ByteArrayInputStream.
All argument validation is disabled in release mode.
- Author:
- (C) 2001, Vlad Roubtsov
Method Summary |
int |
available()
|
void |
close()
Equivalent to reset() . |
int |
read()
|
int |
read(byte[] buf,
int offset,
int length)
|
void |
reset()
Differs from the contruct for InputStream.reset() in that this method
always resets the stream to the same it was immediately after creation. |
long |
skip(long n)
|
Methods inherited from class java.io.InputStream |
mark, markSupported, read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_buf
private final byte[] m_buf
m_max
private final int m_max
m_pos
private int m_pos
NATIVE_COPY_THRESHOLD
private static final int NATIVE_COPY_THRESHOLD
- See Also:
- Constant Field Values
ByteArrayIStream
public ByteArrayIStream(byte[] buf)
ByteArrayIStream
public ByteArrayIStream(byte[] buf,
int length)
read
public final int read()
- Specified by:
read
in class java.io.InputStream
read
public final int read(byte[] buf,
int offset,
int length)
- Overrides:
read
in class java.io.InputStream
available
public final int available()
- Overrides:
available
in class java.io.InputStream
skip
public final long skip(long n)
- Overrides:
skip
in class java.io.InputStream
reset
public final void reset()
- Differs from the contruct for InputStream.reset() in that this method
always resets the stream to the same it was immediately after creation.
- Overrides:
reset
in class java.io.InputStream
close
public final void close()
- Equivalent to
reset()
.
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.InputStream