com.dalsemi.comm
Class SerialOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--com.dalsemi.comm.SerialOutputStream

public class SerialOutputStream
extends OutputStream

An Serial output stream is an output stream for writing data to a serial port.


Constructor Summary
SerialOutputStream(TINISerialPort t)
          Creates a new data output stream to write data to the serial port.
 
Method Summary
 void close()
          Closes this output stream and releases any system resources associated with this stream.
protected  void open()
          Opens a serial output stream for writing.
 void write(byte[] barr, int offset, int len)
          Sends the given array out the serial port.
 void write(int ch)
          Writes the given character to the serial port.
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerialOutputStream

public SerialOutputStream(TINISerialPort t)
Creates a new data output stream to write data to the serial port.
Parameters:
sp - the serial port to use for communications.
Method Detail

open

protected void open()
             throws IOException
Opens a serial output stream for writing.
Throws:
IOException - if an I/O error occurs.

write

public void write(int ch)
           throws IOException
Writes the given character to the serial port. This method blocks until the byte has actually be sent.
Overrides:
write in class OutputStream
Parameters:
ch - the byte to send.
Throws:
IOException -  
See Also:

write

public void write(byte[] barr,
                  int offset,
                  int len)
           throws IOException
Sends the given array out the serial port. This method blocks until all bytes have been sent.
Overrides:
write in class OutputStream
Parameters:
barr - the array to send.
offset - the offset into the array to begin sending.
len - the number of bytes to send.
Throws:
IOException -  
See Also:

close

public void close()
           throws IOException
Closes this output stream and releases any system resources associated with this stream.
Overrides:
close in class OutputStream
Throws:
IOException - if an I/O error occurs.