fr.dyade.aaa.agent.BufferedMessageOutputStream Class Reference

Inherits fr.dyade.aaa.agent.MessageOutputStream.

Inherited by fr.dyade.aaa.agent.PoolNetwork.NetSession.NetworkOutputStream, and fr.dyade.aaa.agent.SimpleNetwork.NetworkOutputStream.

Inheritance diagram for fr.dyade.aaa.agent.BufferedMessageOutputStream:

Inheritance graph
[legend]
Collaboration diagram for fr.dyade.aaa.agent.BufferedMessageOutputStream:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BufferedMessageOutputStream () throws IOException
 BufferedMessageOutputStream (int size) throws IOException
final void write (int b) throws IOException
final void write (byte b[], int off, int len) throws IOException
final void flush () throws IOException

Protected Attributes

OutputStream out

Detailed Description

Class used to send messages through a stream using buffering.

This OutputStream allows the replacement of the underlying stream and the serialisation of object through an internal ObjectOutputStream.

Be careful this OutputStream is not synchronized.

Definition at line 36 of file BufferedMessageOutputStream.java.


Constructor & Destructor Documentation

fr.dyade.aaa.agent.BufferedMessageOutputStream.BufferedMessageOutputStream (  )  throws IOException

Creates a new output stream to write data to an unspecified underlying output stream through a buffer with default size.

Exceptions:
IOException if the internal ObjectOutputStream cannot be correctly initialized.

Definition at line 49 of file BufferedMessageOutputStream.java.

fr.dyade.aaa.agent.BufferedMessageOutputStream.BufferedMessageOutputStream ( int  size  )  throws IOException

Creates a new output stream to write data to an unspecified underlying output stream through a buffer with the specified size.

Parameters:
size the buffer size.
Exceptions:
IllegalArgumentException if size is less than 0.
IOException if the internal ObjectOutputStream cannot be correctly initialized.

Definition at line 62 of file BufferedMessageOutputStream.java.


Member Function Documentation

final void fr.dyade.aaa.agent.BufferedMessageOutputStream.write ( int  b  )  throws IOException [virtual]

Writes the specified byte to this output stream.

Parameters:
b the byte to be written.
Exceptions:
IOException if an I/O error occurs.

Implements fr.dyade.aaa.agent.MessageOutputStream.

Definition at line 85 of file BufferedMessageOutputStream.java.

References fr.dyade.aaa.agent.MessageOutputStream.buf, and fr.dyade.aaa.agent.MessageOutputStream.count.

final void fr.dyade.aaa.agent.BufferedMessageOutputStream.write ( byte  b[],
int  off,
int  len 
) throws IOException [virtual]

Writes len bytes from the specified byte array starting at offset off to this output stream.

Ordinarily this method stores bytes from the given array into this stream's buffer, flushing the buffer to the underlying output stream as needed. If the requested length is at least as large as this stream's buffer, however, then this method will flush the buffer and write the bytes directly to the underlying output stream.

Parameters:
b the data.
off the start offset in the data.
len the number of bytes to write.
Exceptions:
IOException if an I/O error occurs.

Implements fr.dyade.aaa.agent.MessageOutputStream.

Definition at line 106 of file BufferedMessageOutputStream.java.

References fr.dyade.aaa.agent.MessageOutputStream.buf, fr.dyade.aaa.agent.MessageOutputStream.count, fr.dyade.aaa.agent.MessageOutputStream.getLogger(), and fr.dyade.aaa.agent.BufferedMessageOutputStream.out.

Here is the call graph for this function:

final void fr.dyade.aaa.agent.BufferedMessageOutputStream.flush (  )  throws IOException

Flushes this output stream.

This forces any buffered output bytes to be written out to the underlying output stream.

Exceptions:
IOException if an I/O error occurs.

Definition at line 133 of file BufferedMessageOutputStream.java.

References fr.dyade.aaa.agent.BufferedMessageOutputStream.out.


Member Data Documentation

OutputStream fr.dyade.aaa.agent.BufferedMessageOutputStream.out [protected]

The underlying output stream.

Definition at line 40 of file BufferedMessageOutputStream.java.

Referenced by fr.dyade.aaa.agent.BufferedMessageOutputStream.flush(), fr.dyade.aaa.agent.BufferedMessageOutputStream.write(), and fr.dyade.aaa.agent.SimpleNetwork.NetworkOutputStream.writeMessage().


The documentation for this class was generated from the following file:
Generated on Tue Sep 16 16:16:18 2008 for joram by  doxygen 1.5.0