Class NoPadding

    • Constructor Detail

      • NoPadding

        public NoPadding​(int blockSize)
    • Method Detail

      • pad

        public void pad​(ByteArrayOutputStream in)
        Adds the given number of padding bytes to the data input. The value of the padding bytes is determined by the specific padding mechanism that implements this interface.
        Specified by:
        pad in interface IPadding
        Parameters:
        in - the input buffer with the data to pad
        off - the offset in in where the padding bytes are appended
        len - the number of padding bytes to add
        Throws:
        ShortBufferException - if in is too small to hold the padding bytes
      • unpad

        public byte[] unpad​(byte[] in)
        Returns the index where the padding starts.

        Given a buffer with padded data, this method returns the index where the padding starts.

        Specified by:
        unpad in interface IPadding
        Parameters:
        in - the buffer with the padded data
        off - the offset in in where the padded data starts
        len - the length of the padded data
        Returns:
        the index where the padding starts, or -1 if the input is not properly padded
      • getPaddingLength

        public int getPaddingLength​(int inputLength)
        Specified by:
        getPaddingLength in interface IPadding