public class BinaryTCPClientImpl extends AbstractTCPClient
eolByte, useEolByte
Constructor and Description |
---|
BinaryTCPClientImpl() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
hexStringToByteArray(String hexEncodedBinary)
Convert hex string to binary byte array.
|
String |
read(InputStream is)
Reads data until the defined EOM byte is reached.
|
void |
write(OutputStream os,
InputStream is) |
void |
write(OutputStream os,
String hexEncodedBinary)
Input (hex) string is converted to binary and written to the output stream.
|
getCharset, getEolByte, setCharset, setEolByte, setupTest, teardownTest
public static byte[] hexStringToByteArray(String hexEncodedBinary)
hexEncodedBinary
- - hex-encoded binary stringIllegalArgumentException
- if string is not an even number of hex digitspublic void write(OutputStream os, String hexEncodedBinary) throws IOException
os
- output streamhexEncodedBinary
- hex-encoded binaryIOException
- when writing failspublic void write(OutputStream os, InputStream is)
os
- -
OutputStream for socketis
- -
InputStream to be written to Socketpublic String read(InputStream is) throws ReadException
is
- -
InputStream for socketReadException
- when reading failsCopyright © 1998-2017 Apache Software Foundation. All Rights Reserved.