edu.neu.ccs.console
Class ConsoleGateway.ConsoleOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byedu.neu.ccs.console.ConsoleGateway.ConsoleOutputStream
Enclosing class:
ConsoleGateway

public class ConsoleGateway.ConsoleOutputStream
extends OutputStream

Inner class of ConsoleGateway, and derived class of OutputStream that provides output functionality for a console object.

Since:
1.0
Version:
2.1
See Also:
ConsoleGateway

Field Summary
private  int stream
          Identifier for destination of this output stream.
 
Constructor Summary
ConsoleGateway.ConsoleOutputStream(int destination)
          Constructs a console output stream with the given destination.
 
Method Summary
 void close()
          Closes this output stream.
 void flush()
          Flushes this output stream.
 void write(byte[] b)
          Writes b.length bytes to this output stream.
 void write(byte[] b, int offset, int length)
          Writes length bytes from the given byte array to this output stream, starting at the specified offset.
 void write(int b)
          Writes the given byte to this output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

private int stream
Identifier for destination of this output stream.

Constructor Detail

ConsoleGateway.ConsoleOutputStream

public ConsoleGateway.ConsoleOutputStream(int destination)
Constructs a console output stream with the given destination.

Parameters:
destination - the destination stream
Method Detail

close

public void close()
Closes this output stream. This implementation does nothing.


flush

public void flush()
           throws IOException
Flushes this output stream.

Throws:
IOException

write

public void write(byte[] b)
Writes b.length bytes to this output stream.

Parameters:
b - the array of bytes to write

write

public void write(byte[] b,
                  int offset,
                  int length)
Writes length bytes from the given byte array to this output stream, starting at the specified offset.

Parameters:
b - the array of bytes to write
offset - the desired offset
length - the number of bytes to write

write

public void write(int b)
Writes the given byte to this output stream.

Parameters:
b - the byte to write