com.vladium.util
Class ByteArrayIStream

java.lang.Object
  extended byjava.io.InputStream
      extended bycom.vladium.util.ByteArrayIStream

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

Field Summary
private  byte[] m_buf
           
private  int m_max
           
private  int m_pos
           
private static int NATIVE_COPY_THRESHOLD
           
 
Fields inherited from class java.io.InputStream
 
Constructor Summary
ByteArrayIStream(byte[] buf)
           
ByteArrayIStream(byte[] buf, int length)
           
 
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
 

Field Detail

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
Constructor Detail

ByteArrayIStream

public ByteArrayIStream(byte[] buf)

ByteArrayIStream

public ByteArrayIStream(byte[] buf,
                        int length)
Method Detail

read

public final int read()

read

public final int read(byte[] buf,
                      int offset,
                      int length)

available

public final int available()

skip

public final long skip(long n)

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.


close

public final void close()
Equivalent to reset().