org.mbari.siam.utils
Class OutputToInstrument

java.lang.Object
  extended by org.mbari.siam.utils.OutputToInstrument

public class OutputToInstrument
extends java.lang.Object

OutputToInstrument encapsulates an OutputStream; enforces specified delay between writing output bytes, since many instruments have limited processors which might otherwise be overwhelmed by the incoming characters. Note that OutputToInstrument can not directly extend OutputStream, since the OutputStream we have to work with is returned by

Author:
Tom O'Reilly

Constructor Summary
OutputToInstrument(java.io.OutputStream outputStream)
           
 
Method Summary
 void flush()
          Flush all characters to instrument.
 void write(byte[] b)
          Write bytes to instrument, enforcing default delay between writing of each byte.
 void write(byte[] b, int interByteMsec)
          Write bytes to instrument, enforcing specified delay between writing of each byte.
 void write(int b)
          Write a single int to the instrument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputToInstrument

public OutputToInstrument(java.io.OutputStream outputStream)
Method Detail

write

public void write(byte[] b,
                  int interByteMsec)
           throws java.io.IOException
Write bytes to instrument, enforcing specified delay between writing of each byte.

Throws:
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Write bytes to instrument, enforcing default delay between writing of each byte.

Throws:
java.io.IOException

write

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

Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flush all characters to instrument.

Throws:
java.io.IOException


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.