kg.apc.jmeter.samplers.HexStringUDPDecoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmeter-plugins-extras Show documentation
Show all versions of jmeter-plugins-extras Show documentation
Custom plugins set for Apache JMeter
package kg.apc.jmeter.samplers;
import java.nio.ByteBuffer;
import org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl;
import org.apache.jorphan.util.JOrphanUtils;
public class HexStringUDPDecoder implements UDPTrafficDecoder {
public ByteBuffer encode(String data) {
return ByteBuffer.wrap(BinaryTCPClientImpl.hexStringToByteArray(data));
}
public byte[] decode(byte[] buf) {
return JOrphanUtils.baToHexString(buf).getBytes();
}
}