uka.transport
Class MemoryInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byuka.transport.MemoryInputStream

public final class MemoryInputStream
extends java.io.InputStream

An input stream that reads from memory.

Author:
Bernhard Haumacher

Field Summary
(package private)  byte[] buffer
           
(package private)  int lastIndex
          one index behind the last valid value
(package private)  int pos
           
 
Fields inherited from class java.io.InputStream
 
Constructor Summary
MemoryInputStream()
          Before use this object must be initialized by calling set(byte[], int, int).
MemoryInputStream(byte[] buffer)
           
MemoryInputStream(byte[] buffer, int offset, int length)
           
 
Method Summary
 int available()
           
 int getPosition()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 void set(byte[] buffer, int offset, int length)
           
 long skip(long n)
           
 
Methods inherited from class java.io.InputStream
close, mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

byte[] buffer

pos

int pos

lastIndex

int lastIndex
one index behind the last valid value

Constructor Detail

MemoryInputStream

public MemoryInputStream()
Before use this object must be initialized by calling set(byte[], int, int).


MemoryInputStream

public MemoryInputStream(byte[] buffer)

MemoryInputStream

public MemoryInputStream(byte[] buffer,
                         int offset,
                         int length)
Method Detail

set

public void set(byte[] buffer,
                int offset,
                int length)

read

public int read()

read

public int read(byte[] b,
                int off,
                int len)

skip

public long skip(long n)

available

public int available()

getPosition

public int getPosition()