org.apache.jmeter.protocol.tcp.sampler

Class BinaryTCPClientImpl

Implemented Interfaces:
TCPClient

public class BinaryTCPClientImpl
extends AbstractTCPClient

TCPClient implementation. Reads data until the defined EOM byte is reached. If there is no EOM byte defined, then reads until the end of the stream is reached. The EOM byte is defined by the property "tcp.BinaryTCPClient.eomByte". Input data is assumed to be in hex, and is converted to binary

Field Summary

Fields inherited from class org.apache.jmeter.protocol.tcp.sampler.AbstractTCPClient

eolByte, useEolByte

Constructor Summary

BinaryTCPClientImpl()

Method Summary

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.

Methods inherited from class org.apache.jmeter.protocol.tcp.sampler.AbstractTCPClient

getEolByte, setEolByte, setupTest, teardownTest

Constructor Details

BinaryTCPClientImpl

public BinaryTCPClientImpl()

Method Details

hexStringToByteArray

public static final byte[] hexStringToByteArray(String hexEncodedBinary)
Convert hex string to binary byte array.
Parameters:
hexEncodedBinary - - hex-encoded binary string
Returns:
Byte array containing binary representation of input hex-encoded string

read

public String read(InputStream is)
Reads data until the defined EOM byte is reached. If there is no EOM byte defined, then reads until the end of the stream is reached. Response data is converted to hex-encoded binary
Specified by:
read in interface TCPClient
Returns:
hex-encoded binary string

write

public void write(OutputStream os,
                  InputStream is)
Specified by:
write in interface TCPClient

write

public void write(OutputStream os,
                  String hexEncodedBinary)
Input (hex) string is converted to binary and written to the output stream.
Specified by:
write in interface TCPClient
Parameters:
os - output stream
hexEncodedBinary - hex-encoded binary

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.