waba.io
Class Stream
java.lang.Object
|
+--waba.io.Stream
- Direct Known Subclasses:
- ByteArrayOutputStream, Catalog, DataStream, File, ResizeStream, SerialPort, Socket
- public abstract class Stream
- extends java.lang.Object
Stream is the base class for all stream-based I/O classes.
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 |
hashCode,
toString |
Stream
public Stream()
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 intostart
- the start position in the arraycount
- 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 fromstart
- the start position in the byte arraycount
- the number of bytes to write
close
public abstract boolean close()
- Closes the stream. Returns true if the operation is successful
and false otherwise.