All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kg.apc.jmeter.samplers.HexStringUDPDecoder Maven / Gradle / Ivy

There is a newer version: 0.4
Show newest version
package kg.apc.jmeter.samplers;

import org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl;
import org.apache.jorphan.util.JOrphanUtils;

import java.nio.ByteBuffer;

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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy