public class DataPipe
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.io.DataInputStream |
input
The input stream
|
java.io.DataOutputStream |
output
The output stream
|
| Constructor and Description |
|---|
DataPipe() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
copy(java.io.Serializable obj)
A poor-man's clone for serializable but not cloneable objects:
serializes an object to the pipe, then deserializes it.
|
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() |
public java.io.DataInputStream input
public java.io.DataOutputStream output
public void reset()
public int size()
public int numWritten()
public int numRead()
public static java.lang.Object copy(java.io.Serializable obj)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic java.lang.String toString()
toString in class java.lang.Object