Class HexEncoder

  • All Implemented Interfaces:
    io.anyline.nfc.bouncycastle.util.encoders.Encoder

    
    public class HexEncoder
     implements Encoder
                        

    A streaming Hex encoder.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      HexEncoder()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      int encode(Array<byte> inBuf, int inOff, int inLen, Array<byte> outBuf, int outOff)
      int getEncodedLength(int inputLength) Return the expected output length of the encoding.
      int getMaxDecodedLength(int inputLength) Return the maximum expected output length of a decoding.
      int encode(Array<byte> buf, int off, int len, OutputStream out) encode the input data producing a Hex output stream.
      int decode(Array<byte> data, int off, int length, OutputStream out) decode the Hex encoded byte data writing it to the given output stream, whitespace characters will be ignored.
      int decode(String data, OutputStream out) decode the Hex encoded String data writing it to the given output stream, whitespace characters will be ignored.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HexEncoder

        HexEncoder()
    • Method Detail

      • encode

         int encode(Array<byte> inBuf, int inOff, int inLen, Array<byte> outBuf, int outOff)
      • getEncodedLength

         int getEncodedLength(int inputLength)

        Return the expected output length of the encoding.

        Parameters:
        inputLength - the input length of the data.
        Returns:

        the output length of an encoding.

      • getMaxDecodedLength

         int getMaxDecodedLength(int inputLength)

        Return the maximum expected output length of a decoding. If padding is present the value returned will be greater than the decoded data length.

        Parameters:
        inputLength - the input length of the encoded data.
        Returns:

        the upper bound of the output length of a decoding.

      • encode

         int encode(Array<byte> buf, int off, int len, OutputStream out)

        encode the input data producing a Hex output stream.

        Returns:

        the number of bytes produced.

      • decode

         int decode(Array<byte> data, int off, int length, OutputStream out)

        decode the Hex encoded byte data writing it to the given output stream, whitespace characters will be ignored.

        Returns:

        the number of bytes produced.

      • decode

         int decode(String data, OutputStream out)

        decode the Hex encoded String data writing it to the given output stream, whitespace characters will be ignored.

        Returns:

        the number of bytes produced.