Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.net
Class ZOutputStream  view ZOutputStream download ZOutputStream.java

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.ByteArrayOutputStream
          extended byjava.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.
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
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.
 
Methods inherited from class java.io.ByteArrayOutputStream
reset, size, toByteArray, toString, toString, toString, write, writeTo
 
Methods inherited from class java.io.OutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

conn

protected Connector conn
The connector responsible for real sending.

See Also:
Connector
Constructor Detail

ZOutputStream

public ZOutputStream(Connector conn)
This constructor only stores the argument into an internal field.

Method Detail

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.