org.apache.jmeter.protocol.tcp.sampler

## 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

      public class LengthPrefixedBinaryTCPClientImpl
      extends TCPClientDecorator

  Implements binary length-prefixed binary data. This is used in ISO8583 for example.

- - ### 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

    Constructors
    Constructor and Description
    `LengthPrefixedBinaryTCPClientImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte` | `getEolByte()` Not useful, as the byte is never used.
    `java.lang.String` | `read(java.io.InputStream is)` Deprecated.
    `java.lang.String` | `read(java.io.InputStream is, SampleResult sampleResult)` Default implementation calls `TCPClient.read(InputStream)` for backward compatibility
    `void` | `setEolByte(int eolInt)` Set the end-of-line/end-of-message byte.
    `void` | `write(java.io.OutputStream os, java.io.InputStream is)`
    `void` | `write(java.io.OutputStream os, java.lang.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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LengthPrefixedBinaryTCPClientImpl

          public LengthPrefixedBinaryTCPClientImpl()

  - ### Method Detail

    - #### write

          public void write(java.io.OutputStream os,
                            java.lang.String s)
                     throws java.io.IOException

      Parameters:
        `os` - - OutputStream for socket
        `s` - - String to write
      Throws:
        `java.io.IOException` - when writing fails

    - #### write

          public void write(java.io.OutputStream os,
                            java.io.InputStream is)
                     throws java.io.IOException

      Parameters:
        `os` - - OutputStream for socket
        `is` - - InputStream to be written to Socket
      Throws:
        `java.io.IOException` - when writing fails

    - #### read

          @Deprecated
          public java.lang.String read(java.io.InputStream is)
                                            throws ReadException

      Deprecated.
      Parameters:
        `is` - - InputStream for socket
      Returns:
        String read from socket
      Throws:
        `ReadException` - exception that can contain partial response (Response until error occurred)

    - #### read

          public java.lang.String read(java.io.InputStream is,
                                       SampleResult sampleResult)
                                throws ReadException

      Default implementation calls `TCPClient.read(InputStream)` for backward compatibility
      Specified by:
        `read` in interface `TCPClient`
      Overrides:
        `read` in class `AbstractTCPClient`
      Parameters:
        `is` - - InputStream for socket
        `sampleResult` - `SampleResult`
      Returns:
        String read from socket
      Throws:
        `ReadException` - exception that can contain partial response
      See Also:
        `TCPClient.read(java.io.InputStream, org.apache.jmeter.samplers.SampleResult)`

    - #### 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 interface `TCPClient`
      Overrides:
        `getEolByte` in class `AbstractTCPClient`
      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 interface `TCPClient`
      Overrides:
        `setEolByte` in class `AbstractTCPClient`
      Parameters:
        `eolInt` - The value to set

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