public class DataPipe extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) byte[] |
buffer |
DataInputStream |
input
The input stream
|
DataOutputStream |
output
The output stream
|
(package private) int |
pull |
(package private) int |
size |
| Constructor and Description |
|---|
DataPipe() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
copy(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()).
|
(package private) int |
pull() |
(package private) int |
pull(byte[] b,
int offset,
int length) |
(package private) void |
push(byte b) |
(package private) void |
push(byte[] b,
int offset,
int length) |
void |
reset()
Reset the buffer.
|
(package private) void |
resize() |
int |
size()
Returns the total size of the buffer.
|
String |
toString() |
byte[] buffer
int size
int pull
public DataInputStream input
public DataOutputStream output
void resize()
void push(byte b)
void push(byte[] b,
int offset,
int length)
int pull()
int pull(byte[] b,
int offset,
int length)
public void reset()
public int size()
public int numWritten()
public int numRead()
public static Object copy(Serializable obj) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionCopyright © 2014 Evolutionary Computation Laboratory at George Mason University. All rights reserved.