Class LengthPrefixedBinaryTCPClientImpl
java.lang.Object
org.apache.jmeter.protocol.tcp.sampler.AbstractTCPClient
org.apache.jmeter.protocol.tcp.sampler.TCPClientDecorator
org.apache.jmeter.protocol.tcp.sampler.LengthPrefixedBinaryTCPClientImpl
- All Implemented Interfaces:
TCPClient
Implements binary length-prefixed binary data.
This is used in ISO8583 for example. Input/Output strings are passed as hex-encoded binary strings.
2-Byte or 4-Byte length prefixes are supported.
Length prefix is binary of length specified by property "tcp.length.prefix.length".
-
Field Summary
Fields inherited from class org.apache.jmeter.protocol.tcp.sampler.TCPClientDecorator
tcpClient
Fields inherited from class org.apache.jmeter.protocol.tcp.sampler.AbstractTCPClient
eolByte, useEolByte
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte
Not useful, as the byte is never used.read
(InputStream is) Deprecated.read
(InputStream is, SampleResult sampleResult) Default implementation callsTCPClient.read(InputStream)
for backward compatibilityvoid
setEolByte
(int eolInt) Set the end-of-line/end-of-message byte.void
write
(OutputStream os, InputStream is) void
write
(OutputStream os, String s) Methods inherited from class org.apache.jmeter.protocol.tcp.sampler.TCPClientDecorator
byteArrayToInt, intToByteArray
Methods inherited from class org.apache.jmeter.protocol.tcp.sampler.AbstractTCPClient
getCharset, setCharset, setupTest, teardownTest
-
Constructor Details
-
LengthPrefixedBinaryTCPClientImpl
public LengthPrefixedBinaryTCPClientImpl()
-
-
Method Details
-
write
- Parameters:
os
- - OutputStream for sockets
- - String to write- Throws:
IOException
- when writing fails
-
write
- Parameters:
os
- - OutputStream for socketis
- - InputStream to be written to Socket- Throws:
IOException
- when writing fails
-
read
Deprecated.- Parameters:
is
- - InputStream for socket- Returns:
- String read from socket
- Throws:
ReadException
- exception that can contain partial response (Response until error occurred)
-
read
Default implementation callsTCPClient.read(InputStream)
for backward compatibility- Specified by:
read
in interfaceTCPClient
- Overrides:
read
in classAbstractTCPClient
- Parameters:
is
- - InputStream for socketsampleResult
-SampleResult
- Returns:
- String read from socket
- Throws:
ReadException
- exception that can contain partial response- See Also:
-
getEolByte
public byte getEolByte()Not useful, as the byte is never used.Get the end-of-line/end-of-message byte.
- Specified by:
getEolByte
in interfaceTCPClient
- Overrides:
getEolByte
in classAbstractTCPClient
- Returns:
- Returns the eolByte.
-
setEolByte
public void setEolByte(int eolInt) Set the end-of-line/end-of-message byte. If the value is out of range of a byte, then it is to be ignored.- Specified by:
setEolByte
in interfaceTCPClient
- Overrides:
setEolByte
in classAbstractTCPClient
- Parameters:
eolInt
- The value to set
-