|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.hebe.mps.OutputStream
Flattens the bitstream going to an MPS server from MPS primitive types. Uses a Connection object to talk to the other end.
Connection,
InputStream| Field Summary | |
private java.lang.StringBuffer |
buffer
|
private Connection |
connection
|
private java.io.OutputStream |
output
|
| Constructor Summary | |
OutputStream(Connection c)
Construct an OutputStream which encodes the bits going to a Connection object. |
|
OutputStream(java.io.OutputStream o)
Construct an OutputStream which sends bits to an arbitrary inputstream. |
|
| Method Summary | |
void |
flush()
Sends the total accumulated buffer of bytes over the connection. |
private void |
open()
Causes the connection to the server to open, if it isn't already open. |
void |
resetBuffer()
Resets our internal buffer to empty. |
private void |
setupBuffer()
Creates and initialises a fresh StringBuffer in member variable buffer. |
private void |
write(int ch)
Buffer up a single byte to send. |
void |
writebool(boolean b)
Writes a single boolean to the server. |
void |
writechar(char ch)
Writes a single char to the server. |
void |
writefloat(float f)
Writes a single float to the server. |
void |
writeint(int i)
Writes a single int to the server. |
void |
writelong(long i)
Writes a single long to the server. |
void |
writeReference(java.lang.Object o)
Writes a reference to an MPS object to the remote end. |
void |
writestring(java.lang.String s)
Writes a single java.lang.String to the server. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private Connection connection
private java.io.OutputStream output
private java.lang.StringBuffer buffer
| Constructor Detail |
public OutputStream(Connection c)
c - the raw connection to usepublic OutputStream(java.io.OutputStream o)
o - the raw outputstream to use| Method Detail |
private void setupBuffer()
public void resetBuffer()
private void write(int ch)
ch - the byte to buffer upflush()
private void open()
throws MPSException
MPSException - from connection.getOutputStream() if there's a problemConnection.getOutputStream()public void writeint(int i)
i - the 32-bit signed value to writepublic void writestring(java.lang.String s)
s - the string to writepublic void writebool(boolean b)
b - the boolean to writepublic void writelong(long i)
i - the long to writepublic void writechar(char ch)
ch - the char to write
public void writeReference(java.lang.Object o)
throws MPSException
o - the MPS Interface to writeMPSException - if there's a problem writingMPSException - if o is not being
served by an instance of Server and o is not an
instance of ProxyProxy,
InputStream.readReference()
public void writefloat(float f)
throws MPSException
f - the float to writeMPSException - if there's a problem writing
public void flush()
throws MPSException
MPSException - if there's a problem writing.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||