Package com.db4o.io

Class BlockAwareBinWindow


  • public class BlockAwareBinWindow
    extends java.lang.Object
    Bounded handle into an IoAdapter: Can only access a restricted area.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void disable()
      Disable IO Adapter Window
      void flush()
      Flush IO Adapter Window
      int length()  
      int read​(int off, byte[] data)  
      void write​(int off, byte[] data)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BlockAwareBinWindow

        public BlockAwareBinWindow​(BlockAwareBin io,
                                   int blockOff,
                                   int len)
        Parameters:
        io - The delegate I/O adapter
        blockOff - The block offset address into the I/O adapter that maps to the start index (0) of this window
        len - The size of this window in bytes
    • Method Detail

      • length

        public int length()
        Returns:
        Size of this I/O adapter window in bytes.
      • write

        public void write​(int off,
                          byte[] data)
                   throws java.lang.IllegalArgumentException,
                          java.lang.IllegalStateException
        Parameters:
        off - Offset in bytes relative to the window start
        data - Data to write into the window starting from the given offset
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
      • read

        public int read​(int off,
                        byte[] data)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalStateException
        Parameters:
        off - Offset in bytes relative to the window start
        data - Data buffer to read from the window starting from the given offset
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalStateException
      • disable

        public void disable()
        Disable IO Adapter Window
      • flush

        public void flush()
        Flush IO Adapter Window