org.mbari.siam.core
Class InstrumentPortOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.mbari.siam.core.InstrumentPortOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class InstrumentPortOutputStream
extends java.io.OutputStream

InstrumentPortOutputStream enforces inter-byte delay when writing to the instrument


Field Summary
protected static org.apache.log4j.Logger _log4j
           
 
Constructor Summary
InstrumentPortOutputStream(InstrumentPort port, java.io.OutputStream os)
          Create a new InstrumentPortInputStream
 
Method Summary
 void close()
          Close the outputstream
 void flush()
          Flush the outputstream
 void setInterByteMsec(int interByteMsec)
          Set inter-byte millisec delay to specified value.
 void write(byte[] b)
          Writes b.length bytes from specified byte array to output stream, enforcing inter-byte delay.
 void write(byte[] b, int offset, int nBytes)
          Writes nBytes bytes from specified byte array starting at specified offset to output stream, enforcing inter-byte delay.
 void write(int b)
          Write a char to the outputstream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log4j

protected static org.apache.log4j.Logger _log4j
Constructor Detail

InstrumentPortOutputStream

public InstrumentPortOutputStream(InstrumentPort port,
                                  java.io.OutputStream os)
Create a new InstrumentPortInputStream

Method Detail

write

public void write(int b)
           throws java.io.IOException
Write a char to the outputstream

Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Writes b.length bytes from specified byte array to output stream, enforcing inter-byte delay.

Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int offset,
                  int nBytes)
           throws java.io.IOException
Writes nBytes bytes from specified byte array starting at specified offset to output stream, enforcing inter-byte delay.

Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flush the outputstream

Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.OutputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close the outputstream

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.OutputStream
Throws:
java.io.IOException

setInterByteMsec

public void setInterByteMsec(int interByteMsec)
Set inter-byte millisec delay to specified value.



Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.