Class RawDataIo

    • Field Detail

      • cipher

        private javax.crypto.Cipher cipher
      • isEncrypted

        private boolean isEncrypted
      • dataPool

        private final java.util.LinkedList<java.lang.Byte> dataPool
      • reused

        private final byte[] reused
    • Method Detail

      • getCipher

        public javax.crypto.Cipher getCipher()
      • setCipher

        public void setCipher​(javax.crypto.Cipher cipher)
      • getPosition

        public long getPosition()
                         throws java.io.IOException
        Specified by:
        getPosition in interface SeekableReadOnlyByteChannel
        Returns:
        the current position in the channel
        Throws:
        java.io.IOException - .
      • setPosition

        public void setPosition​(long pos)
                         throws java.io.IOException
        Specified by:
        setPosition in interface SeekableReadOnlyByteChannel
        Parameters:
        pos - the position in the channel
        Throws:
        java.io.IOException - .
      • read

        public int read​(byte[] buffer,
                        int off,
                        int count)
                 throws java.io.IOException
        Description copied from interface: SeekableReadOnlyByteChannel
        Read up to count bytes to the specified buffer.
        Specified by:
        read in interface SeekableReadOnlyByteChannel
        Parameters:
        buffer - .
        off - .
        count - .
        Returns:
        read read
        Throws:
        java.io.IOException - .
      • readFully

        public int readFully​(byte[] buffer,
                             int count)
                      throws java.io.IOException
        Description copied from interface: SeekableReadOnlyByteChannel
        Read exactly count bytes to the specified buffer.
        Specified by:
        readFully in interface SeekableReadOnlyByteChannel
        Parameters:
        buffer - where to store the read data
        count - how many bytes to read
        Returns:
        bytes read || -1 if IO problem
        Throws:
        java.io.IOException - .