waba.io
Class Stream

waba.lang.Object
  |
  +--waba.io.Stream
Direct Known Subclasses:
Catalog, File, SerialPort, Socket

public abstract class Stream
extends Object

Stream is the base class for all stream-based I/O classes.


Constructor Summary
Stream()
           
 
Method Summary
abstract  boolean close()
          Closes the stream.
abstract  int readBytes(byte[] buf, int start, int count)
          Reads bytes from the stream.
abstract  int writeBytes(byte[] buf, int start, int count)
          Writes bytes to the the stream.
 
Methods inherited from class waba.lang.Object
toString
 

Constructor Detail

Stream

public Stream()
Method Detail

readBytes

public abstract int readBytes(byte[] buf,
                              int start,
                              int count)
Reads bytes from the stream. Returns the number of bytes actually read or -1 if an error prevented the read operation from occurring.
Parameters:
buf - the byte array to read data into
start - the start position in the array
count - the number of bytes to read

writeBytes

public abstract int writeBytes(byte[] buf,
                               int start,
                               int count)
Writes bytes to the the stream. Returns the number of bytes actually written or -1 if an error prevented the write operation from occurring.
Parameters:
buf - the byte array to write data from
start - the start position in the byte array
count - the number of bytes to write

close

public abstract boolean close()
Closes the stream. Returns true if the operation is successful and false otherwise.