|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream java.io.FilterOutputStream net.wimpi.modbus.io.ASCIIOutputStream
public class ASCIIOutputStream
Class implementing a specialized OutputStream which encodes bytes written to the stream into two hexadecimal characters each. Note that the "virtual" characters FRAME_START and FRAME_END are exceptions, they are translated to the respective characters as given by the specification.
ModbusASCIITransport.FRAME_START
,
ModbusASCIITransport.FRAME_END
Constructor Summary | |
---|---|
ASCIIOutputStream(OutputStream out)
Constructs a new ASCIIOutputStream instance writing to the given OutputStream. |
Method Summary | |
---|---|
void |
write(byte[] data)
Writes an array of bytes encoded as two hexadecimal characters to the raw output stream. |
void |
write(byte[] data,
int off,
int len)
Writes an array of bytes encoded as two hexadecimal characters to the raw output stream. |
void |
write(int b)
Writes a byte encoded as two hexadecimal characters to the raw output stream. |
Methods inherited from class java.io.FilterOutputStream |
---|
close, flush |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ASCIIOutputStream(OutputStream out)
out
- a base output stream instance to be wrapped.Method Detail |
---|
public void write(int b) throws IOException
write
in class FilterOutputStream
b
- the byte to be written as int.
IOException
- if an I/O error occurs.public void write(byte[] data) throws IOException
write
in class FilterOutputStream
data
- the byte[] to be written.
IOException
- if an I/O error occurs.public void write(byte[] data, int off, int len) throws IOException
write
in class FilterOutputStream
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.
IOException
- if an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |