Class CBufferReadWrite

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class CBufferReadWrite
    extends CDataReadWriteAccess
    • Constructor Detail

      • CBufferReadWrite

        public CBufferReadWrite​(java.nio.ByteBuffer rawData,
                                long address,
                                int pointerSize)
    • Method Detail

      • readShort

        public short readShort()
                        throws java.io.IOException
        Specified by:
        readShort in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • readInt

        public int readInt()
                    throws java.io.IOException
        Specified by:
        readInt in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • readInt64

        public long readInt64()
                       throws java.io.IOException
        Specified by:
        readInt64 in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • readFloat

        public float readFloat()
                        throws java.io.IOException
        Specified by:
        readFloat in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • readDouble

        public double readDouble()
                          throws java.io.IOException
        Specified by:
        readDouble in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • offset

        public long offset()
                    throws java.io.IOException
        Specified by:
        offset in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • offset

        public void offset​(long offset)
                    throws java.io.IOException
        Specified by:
        offset in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Specified by:
        skip in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • available

        public int available()
                      throws java.io.IOException
        Specified by:
        available in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • padding

        public void padding​(int alignment,
                            boolean extend)
                     throws java.io.IOException
        Description copied from class: CDataReadWriteAccess
        Inserts padding at a given offset to fit a given alignment during reading or writing in streams. In case of writing, the stream can't just skip past the end and needs to actually write. The parameter 'extend' tells this method whether it is allowed to extend past the end or not.
        Specified by:
        padding in class CDataReadWriteAccess
        Parameters:
        alignment - Requrested aligment
        extend - Extend past boundary (write mode)
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • readByte

        public byte readByte()
                      throws java.io.IOException
        Specified by:
        readByte in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • readFully

        public void readFully​(byte[] b,
                              int off,
                              int len)
                       throws java.io.IOException
        Overrides:
        readFully in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • writeByte

        public void writeByte​(int value)
                       throws java.io.IOException
        Specified by:
        writeByte in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • writeShort

        public void writeShort​(short value)
                        throws java.io.IOException
        Specified by:
        writeShort in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • writeInt

        public void writeInt​(int value)
                      throws java.io.IOException
        Specified by:
        writeInt in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • writeInt64

        public void writeInt64​(long value)
                        throws java.io.IOException
        Specified by:
        writeInt64 in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • writeFloat

        public void writeFloat​(float value)
                        throws java.io.IOException
        Specified by:
        writeFloat in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • writeDouble

        public void writeDouble​(double value)
                         throws java.io.IOException
        Specified by:
        writeDouble in class CDataReadWriteAccess
        Throws:
        java.io.IOException
      • getBytes

        public byte[] getBytes()
        provides access to the native data buffer. This is supposed to be used by internal methods only, which know how to handle the data.