java.net
Class ZOutputStream

java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
java.net.ZOutputStream
- public class ZOutputStream
- extends java.io.ByteArrayOutputStream
This object models an output stream that sends data through a Connector instance.
Everything is written to this output stream becomes a ZObject instance and gets sent through
the Connector.
- Version:
- 1.0
|
Field Summary |
protected Connector |
conn
The connector responsible for real sending. |
|
Constructor Summary |
ZOutputStream(Connector conn)
This constructor only stores the argument into an internal field. |
|
Method Summary |
void |
flush()
This method really sends the stored data (if any) from the underlying ByteArrayOutputStream through
the connector to the socket. |
void |
write(byte[] b,
int off,
int len)
This method writes the buffer to the underlying ByteArrayOutputStream and then flushes it
using the connector through the flush 55 method. |
conn
protected Connector conn
- The connector responsible for real sending.
- See Also:
- Connector
ZOutputStream
public ZOutputStream(Connector conn)
- This constructor only stores the argument into an internal field.
write
public void write(byte[] b,
int off,
int len)
- This method writes the buffer to the underlying ByteArrayOutputStream and then flushes it
using the connector through the flush 55 method.
flush
public void flush()
throws java.io.IOException
- This method really sends the stored data (if any) from the underlying ByteArrayOutputStream through
the connector to the socket.
After data sending, the underlying stream is reset to the empty state.