org.hecl.files
Class HeclChannel

java.lang.Object
  extended by org.hecl.files.HeclChannel

public class HeclChannel
extends java.lang.Object

The HeclChannel class acts as a container for a data input stream and/or data output stream. This makes it possible to both read and write from one "channel".

Version:
1.0
Author:
David N. Welton

Field Summary
 java.io.DataInputStream datainputstream
          datainputstream is the stream that this channel reads from.
 java.io.DataOutputStream dataoutputstream
          dataoutputstream is the stream this channel writes to.
 
Constructor Summary
HeclChannel(java.io.DataInputStream dis)
          Creates a new read-only HeclChannel instance.
HeclChannel(java.io.DataInputStream dis, java.io.DataOutputStream dos)
          Creates a new HeclChannel instance for reading and writing.
HeclChannel(java.io.DataOutputStream dos)
          Creates a new write-only HeclChannel instance.
 
Method Summary
 boolean readable()
          readable returns true if the channel is open for reading.
 boolean writable()
          writable returns true if the channel is open for writing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

datainputstream

public java.io.DataInputStream datainputstream
datainputstream is the stream that this channel reads from.


dataoutputstream

public java.io.DataOutputStream dataoutputstream
dataoutputstream is the stream this channel writes to.

Constructor Detail

HeclChannel

public HeclChannel(java.io.DataInputStream dis)
Creates a new read-only HeclChannel instance.

Parameters:
dis - a DataInputStream value

HeclChannel

public HeclChannel(java.io.DataOutputStream dos)
Creates a new write-only HeclChannel instance.

Parameters:
dos - a DataOutputStream value

HeclChannel

public HeclChannel(java.io.DataInputStream dis,
                   java.io.DataOutputStream dos)
Creates a new HeclChannel instance for reading and writing.

Parameters:
dis - a DataInputStream value
dos - a DataOutputStream value
Method Detail

readable

public boolean readable()
readable returns true if the channel is open for reading.

Returns:
a boolean value

writable

public boolean writable()
writable returns true if the channel is open for writing.

Returns:
a boolean value