ec.util
Class DataPipe

java.lang.Object
  extended by ec.util.DataPipe

public class DataPipe
extends java.lang.Object


Field Summary
 java.io.DataInputStream input
          The input stream
 java.io.DataOutputStream output
          The output stream
 
Constructor Summary
DataPipe()
           
 
Method Summary
 int numRead()
          Returns the number of elements read from the buffer so far (after the last reset()).
 int numWritten()
          Returns the number of elements written to the buffer so far (after the last reset()).
 void reset()
          Reset the buffer.
 int size()
          Returns the total size of the buffer.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

input

public java.io.DataInputStream input
The input stream


output

public java.io.DataOutputStream output
The output stream

Constructor Detail

DataPipe

public DataPipe()
Method Detail

reset

public void reset()
Reset the buffer. Does not resize it back to a smaller size -- if it has ballooned it will stay large, though it will no longer have wasted space in it. If you wish to make the buffer a more manageable size, create a new DataPipe instead.


size

public int size()
Returns the total size of the buffer.


numWritten

public int numWritten()
Returns the number of elements written to the buffer so far (after the last reset()).


numRead

public int numRead()
Returns the number of elements read from the buffer so far (after the last reset()).


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object