Class BCryptPasswordImpl.CyclicByteBuffer

  • All Implemented Interfaces:
    Serializable
    Enclosing class:
    BCryptPasswordImpl

    private static class BCryptPasswordImpl.CyclicByteBuffer
    extends Object
    implements Serializable

    This class implements a cyclic byte buffer. It defines utility methods to retrieve the next byte or int from the underlying byte[] in a cyclic manner.

    • Field Detail

      • buffer

        private byte[] buffer
      • position

        private int position
    • Constructor Detail

      • CyclicByteBuffer

        CyclicByteBuffer​(byte[] buffer)
    • Method Detail

      • readNextByte

        byte readNextByte()
        Reads the next byte from the buffer. The current position is incremented by one (mod buffer.length).
        Returns:
        the byte that was read from the cyclic buffer.
      • readNextInt

        int readNextInt()
        Reads the next int (four bytes) from the buffer. The current position is incremented by four (mod buffer.length).
        Returns:
        the int that was read from the cyclic buffer.