client
Class ClientOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by client.ClientOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

final class ClientOutputStream
extends java.io.OutputStream

OutputStream used by user (application) to send data anonymously via a mix cascade. Abstracts from the underlying technique.

Author:
Karl-Peter Fuchs

Field Summary
private  Client client
          Reference on the Client using this Stream.
private  boolean isClosed
          Indicates whether this OutputStream is ready to use or not.
 
Constructor Summary
protected ClientOutputStream(Client client)
          Generates a new OutputStream that can be used to send data anonymously via a mix cascade.
 
Method Summary
 void close()
          Closes this OutputStream.
 void flush()
          Has no effect (since internally, data must be written synchronously (request and reply alternately)).
 void write(byte[] b)
          Writes b.length bytes from the specified array to this OutputStream.
 void write(byte[] b, int off, int len)
          Writes len bytes from the specified array starting at off to this OutputStream.
 void write(int b)
          Writes the specified byte to this OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

client

private Client client
Reference on the Client using this Stream.


isClosed

private boolean isClosed
Indicates whether this OutputStream is ready to use or not.

Constructor Detail

ClientOutputStream

protected ClientOutputStream(Client client)
Generates a new OutputStream that can be used to send data anonymously via a mix cascade.

Parameters:
client - Reference on the Client using this Stream.
Method Detail

close

public void close()
           throws java.io.IOException
Closes this OutputStream.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException - If an I/O error occurs.

write

public void write(byte[] b)
           throws java.io.IOException
Writes b.length bytes from the specified array to this OutputStream.

Overrides:
write in class java.io.OutputStream
Parameters:
b - Data to be written.
Throws:
java.io.IOException - If an I/O error occurs.

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Writes len bytes from the specified array starting at off to this OutputStream.

Overrides:
write in class java.io.OutputStream
Parameters:
b - Array containing the data to be written.
off - Start offset in b.
len - Number of bytes to be written (starting at off).
Throws:
java.io.IOException - If an I/O error occurs.

write

public void write(int b)
           throws java.io.IOException
Writes the specified byte to this OutputStream.

Specified by:
write in class java.io.OutputStream
Parameters:
b - The byte to be written.
Throws:
java.io.IOException - If an I/O error occurs.

flush

public void flush()
           throws java.io.IOException
Has no effect (since internally, data must be written synchronously (request and reply alternately)).

Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException