Class HexCodec

java.lang.Object
org.cryptacular.codec.HexCodec
All Implemented Interfaces:
Codec

public class HexCodec extends Object implements Codec
Hexadecimal encoder/decoder pair.
Author:
Middleware Services
  • Constructor Details

    • HexCodec

      public HexCodec()
      Creates a new instance that outputs lowercase hex characters and supports decoding in either case.
    • HexCodec

      public HexCodec(boolean uppercaseOutput)
      Creates a new instance that optionally outputs uppercase hex characters and supports decoding in either case.
      Parameters:
      uppercaseOutput - True to output uppercase alphabetic characters, false for lowercase.
  • Method Details

    • getEncoder

      public Encoder getEncoder()
      Specified by:
      getEncoder in interface Codec
      Returns:
      The byte-to-char encoder of the codec pair.
    • getDecoder

      public Decoder getDecoder()
      Specified by:
      getDecoder in interface Codec
      Returns:
      The char-to-byte decoder of the codec pair.
    • newEncoder

      public Encoder newEncoder()
      Specified by:
      newEncoder in interface Codec
      Returns:
      A new instance of the byte-to-char encoder of the codec pair.
    • newDecoder

      public Decoder newDecoder()
      Specified by:
      newDecoder in interface Codec
      Returns:
      A new instance of the char-to-byte decoder of the codec pair.