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

InputStream Class Reference

Structures the bitstream coming from an MPS server into usable MPS primitive types (mapped onto Java types, of course). More...

Collaboration diagram for InputStream:

Collaboration graph
[legend]
List of all members.

Private Methods

public InputStream (Connection c)
public InputStream (java.io.InputStream i)
private int read () throws IOException, MPSException
private void open () throws MPSException
public int readint () throws MPSException
public String readstring () throws MPSException
public boolean readbool () throws MPSException
public long readlong () throws MPSException
public char readchar () throws MPSException
public String readReference () throws MPSException
public float readfloat () throws MPSException

Private Attributes

private Connection connection
private java io InputStream input

Detailed Description

Structures the bitstream coming from an MPS server into usable MPS primitive types (mapped onto Java types, of course).

Uses a Connection object to talk to the other end.

Author(s):
Tony Garnock-Jones <tonyg@kcbbs.gen.nz>
See also:
org.hebe.mps.Connection , org.hebe.mps.OutputStream

Definition at line 49 of file InputStream.java.


Constructor & Destructor Documentation

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

Construct an InputStream which decodes the bits coming from a Connection object.

Parameters:
c   the raw connection to filter

Definition at line 59 of file InputStream.java.

public InputStream::InputStream ( java.io.InputStream i ) [inline, private]
 

Construct an InputStream which decodes bits from an arbitrary inputstream.

Parameters:
i   the raw inputstream to filter

Definition at line 70 of file InputStream.java.


Member Function Documentation

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

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

Exceptions:
MPSException   from connection.getInputStream() if there's a problem
See also:
org.hebe.mps.ConnectiongetInputStream

Definition at line 97 of file InputStream.java.

Referenced by readbool(), readchar(), readfloat(), readint(), readlong(), and readstring().

private int InputStream::read ( ) [inline, private]
 

Reads a single byte from the server.

Returns:
the byte read
Exceptions:
IOException   if there's an error reading our input
MPSConnectionClosedException   if the connection closes unexpectedly

Definition at line 82 of file InputStream.java.

Referenced by readbool(), readchar(), readint(), readlong(), and readstring().

public String InputStream::readReference ( ) [inline, private]
 

Reads the canonical (bound) name of an MPS object from the remote end of the link.

Returns:
the canonical name of the object read from the server
Exceptions:
MPSException   if there's a problem reading
See also:
org.hebe.mps.OutputStreamwriteReference

Definition at line 212 of file InputStream.java.

public boolean InputStream::readbool ( ) [inline, private]
 

Reads a single boolean from the server.

Returns:
the boolean read
Exceptions:
MPSException   if there's a problem reading

Definition at line 156 of file InputStream.java.

public char InputStream::readchar ( ) [inline, private]
 

Reads a single char from the server.

Returns:
the char read
Exceptions:
MPSException   if there's a problem reading

Definition at line 195 of file InputStream.java.

public float InputStream::readfloat ( ) [inline, private]
 

Reads a single float from the server.

Returns:
the float read
Exceptions:
MPSException   if there's a problem reading

Definition at line 222 of file InputStream.java.

public int InputStream::readint ( ) [inline, private]
 

Reads a single int from the server.

Returns:
the 32-bit signed value read from our input
Exceptions:
MPSException   if there's a problem reading

Definition at line 108 of file InputStream.java.

Referenced by Proxy::getInputStream(), readfloat(), and Server::Runnable::run().

public long InputStream::readlong ( ) [inline, private]
 

Reads a single 64-bit long from the server.

Returns:
the long read
Exceptions:
MPSException   if there's a problem reading

Definition at line 171 of file InputStream.java.

public String InputStream::readstring ( ) [inline, private]
 

Reads a single java.lang.String from the server.

Returns:
the string read
See also:
java.lang.String
Exceptions:
MPSException   if there's a problem reading

Definition at line 129 of file InputStream.java.

Referenced by readReference().


Member Data Documentation

private Connection InputStream::connection [private]
 

Definition at line 50 of file InputStream.java.

private java io InputStream InputStream::input [private]
 

Definition at line 51 of file InputStream.java.


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