jamod at SF

net.wimpi.modbus.io
Class BINOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended bynet.wimpi.modbus.io.BINOutputStream

public class BINOutputStream
extends java.io.FilterOutputStream

Class implementing a specialized OutputStream which duplicates bytes written to the stream that resemble a frame token. Note that the "virtual" characters FRAME_START and FRAME_END are exceptions, they are translated to the respective tokens as given by the specification.

Version:
1.2rc1 (09/11/2004)
Author:
Dieter Wimberger
See Also:
ModbusBINTransport.FRAME_START, ModbusBINTransport.FRAME_END

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
BINOutputStream(java.io.OutputStream out)
          Constructs a new BINOutputStream instance writing to the given OutputStream.
 
Method Summary
 void write(byte[] data)
          Writes an array of bytes to the raw output stream.
 void write(byte[] data, int off, int len)
          Writes an array of bytes to the raw output stream.
 void write(int b)
          Writes a byte to the raw output stream.
 
Methods inherited from class java.io.FilterOutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BINOutputStream

public BINOutputStream(java.io.OutputStream out)
Constructs a new BINOutputStream instance writing to the given OutputStream.

Parameters:
out - a base output stream instance to be wrapped.
Method Detail

write

public void write(int b)
           throws java.io.IOException
Writes a byte to the raw output stream. Bytes resembling a frame token will be duplicated.

Parameters:
b - the byte to be written as int.
Throws:
java.io.IOException - if an I/O error occurs.

write

public void write(byte[] data)
           throws java.io.IOException
Writes an array of bytes to the raw output stream. Bytes resembling a frame token will be duplicated.

Parameters:
data - the byte[] to be written.
Throws:
java.io.IOException - if an I/O error occurs.

write

public void write(byte[] data,
                  int off,
                  int len)
           throws java.io.IOException
Writes an array of bytes to the raw output stream. Bytes resembling a frame token will be duplicated. *

Parameters:
data - the byte[] to be written.
off - the offset into the data to start writing from.
len - the number of bytes to be written from off.
Throws:
java.io.IOException - if an I/O error occurs.

jamod at SF

Copyright © 2002-2004 jamod development team.