util
Class InputStreamAsBytes

java.lang.Object
  extended by util.InputStreamAsBytes

public class InputStreamAsBytes
extends java.lang.Object

Reads the data from a given InputStream, making it available as an array of bytes.


Field Summary
static boolean DO_LIST
          Flag controlling listing of the blocks (for debugging).
 
Constructor Summary
InputStreamAsBytes(java.io.InputStream ins)
          Constructs a new scanner for the given stream, and obtains the data from it.
 
Method Summary
 byte[] getBytes()
          Returns the byte sequence obtained from the stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DO_LIST

public static boolean DO_LIST
Flag controlling listing of the blocks (for debugging).

Constructor Detail

InputStreamAsBytes

public InputStreamAsBytes(java.io.InputStream ins)
                   throws java.io.IOException
Constructs a new scanner for the given stream, and obtains the data from it.

Throws:
java.io.IOException
Method Detail

getBytes

public byte[] getBytes()
Returns the byte sequence obtained from the stream. NB There is no protection against multiple invocations of this method in a context in which the shared data buffer is modified by one of the callers.