Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

OutputStream Class Reference

Flattens the bitstream going to an MPS server from MPS primitive types. More...

Collaboration diagram for OutputStream:

Collaboration graph
List of all members.

Private Methods

public OutputStream (Connection c)
private void setupBuffer ()
public void resetBuffer ()
public OutputStream ( o)
private void write (int ch)
private void open () throws MPSException
public void writeint (int i)
public void writestring (String s)
public void writebool (boolean b)
public void writelong (long i)
public void writechar (char ch)
public void writeReference (Object o) throws MPSException
public void writefloat (float f) throws MPSException
public void flush () throws MPSException

Private Attributes

private Connection connection
private java io OutputStream output
private StringBuffer buffer

Detailed Description

Flattens the bitstream going to an MPS server from MPS primitive types.

Uses a Connection object to talk to the other end.

Tony Garnock-Jones <>
See also:
org.hebe.mps.Connection , org.hebe.mps.InputStream

Definition at line 48 of file

Constructor & Destructor Documentation

public OutputStream::OutputStream ( Connection c ) [inline, private]

Construct an OutputStream which encodes the bits going to a Connection object.

c   the raw connection to use

Definition at line 59 of file

public OutputStream::OutputStream ( o ) [inline, private]

Construct an OutputStream which sends bits to an arbitrary inputstream.

o   the raw outputstream to use

Definition at line 84 of file

Member Function Documentation

public void OutputStream::flush ( ) [inline, private]

Sends the total accumulated buffer of bytes over the connection.

Empties the buffer ready for the next batch of bytes.

MPSException   if there's a problem writing.

Definition at line 235 of file

private void OutputStream::open ( ) [inline, private]

Causes the connection to the server to open, if it isn't already open.

MPSException   from connection.getOutputStream() if there's a problem
See also:

Definition at line 117 of file

Referenced by flush().

public void OutputStream::resetBuffer ( ) [inline, private]

Resets our internal buffer to empty.

Definition at line 74 of file

Referenced by Server::Runnable::run().

private void OutputStream::setupBuffer ( ) [inline, private]

Creates and initialises a fresh StringBuffer in member variable buffer.

Definition at line 68 of file

Referenced by OutputStream(), flush(), and resetBuffer().

private void OutputStream::write ( int ch ) [inline, private]

Buffer up a single byte to send.

The buffer is not flushed to the server until the flush() method is called.

ch   the byte to buffer up
See also:

Definition at line 97 of file

Referenced by flush(), writebool(), writechar(), writeint(), writelong(), and writestring().

public void OutputStream::writeReference ( Object o ) [inline, private]

Writes a reference to an MPS object to the remote end.

Sends a canonical name for the object as a string. The remote end will then construct a proxy on the other side of the connection to make use of the reference that has been sent to it.

o   the MPS Interface to write
MPSException   if there's a problem writing
MPSException   if o is not being served by an instance of Server and o is not an instance of Proxy

See also:
org.hebe.mps.Proxy , org.hebe.mps.InputStreamreadReference

Definition at line 198 of file

public void OutputStream::writebool ( boolean b ) [inline, private]

Writes a single boolean to the server.

b   the boolean to write

Definition at line 154 of file

public void OutputStream::writechar ( char ch ) [inline, private]

Writes a single char to the server.

ch   the char to write

Definition at line 179 of file

public void OutputStream::writefloat ( float f ) [inline, private]

Writes a single float to the server.

f   the float to write
MPSException   if there's a problem writing

Definition at line 224 of file

public void OutputStream::writeint ( int i ) [inline, private]

Writes a single int to the server.

i   the 32-bit signed value to write

Definition at line 127 of file

Referenced by Proxy::getOutputStream(), Server::Runnable::run(), and writefloat().

public void OutputStream::writelong ( long i ) [inline, private]

Writes a single long to the server.

i   the long to write

Definition at line 163 of file

public void OutputStream::writestring ( String s ) [inline, private]

Writes a single java.lang.String to the server.

s   the string to write

Definition at line 139 of file

Referenced by writeReference().

Member Data Documentation

private StringBuffer OutputStream::buffer [private]

Definition at line 51 of file

private Connection OutputStream::connection [private]

Definition at line 49 of file

private java io OutputStream OutputStream::output [private]

Definition at line 50 of file

The documentation for this class was generated from the following file:
Generated at Wed Aug 15 01:05:35 2001 for mps-java by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001