Class COSFilterASCIIHexDecode

    • Constructor Detail

      • COSFilterASCIIHexDecode

        public COSFilterASCIIHexDecode​(ASInputStream stream)
                                throws IOException
        Constructor from encoded stream.
        Parameters:
        stream - is ASCII Hex encoded stream.
        Throws:
        IOException
    • Method Detail

      • read

        public int read​(byte[] buffer,
                        int size)
                 throws IOException
        Reads up to size bytes of ASCII Hex decoded data into buffer.
        Overrides:
        read in class ASBufferedInFilter
        Parameters:
        buffer - is byte array where decoded data will be read.
        size - is maximal amount of decoded bytes.
        Returns:
        amount of actually read bytes.
        Throws:
        IOException
      • decodeLoHex

        public static byte decodeLoHex​(byte val)
        Converts char byte to it's hex value, e.g. '1' -> 1 and 'A' -> 10.
        Parameters:
        val - is character that should be hexadecimal digit.
        Returns:
        actual value for this character or 127 if character is not a valid hex digit.