waba.io
Class Stream

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

public abstract class Stream
extends java.lang.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.