Interface BinaryDataFile

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      void close()  
      default boolean isEmpty()
      Return whether this is an empty file or not
      boolean isOpen()
      Is it open?
      long length()
      Return the length of the file (including any buffered writes)
      void open()
      Open the file
      default int read​(long posn, byte[] b)
      Read into a byte array, returning the number of bytes read.
      int read​(long posn, byte[] b, int start, int length)
      Read into a byte array, returning the number of bytes read.
      void sync()  
      void truncate​(long length)
      Truncate the file
      default long write​(byte[] b)
      Write bytes - bytes are always written to the end of the file.
      long write​(byte[] b, int start, int length)
      Write bytes - bytes are always written to the end of the file.
    • Method Detail

      • open

        void open()
        Open the file
      • isOpen

        boolean isOpen()
        Is it open?
      • read

        default int read​(long posn,
                         byte[] b)
        Read into a byte array, returning the number of bytes read. Reads are at an absolute position and a read is atomic/thread-safe.
        Parameters:
        posn - Location of the read operation.
        b - byte array
        Returns:
        The number of bytes read
      • read

        int read​(long posn,
                 byte[] b,
                 int start,
                 int length)
        Read into a byte array, returning the number of bytes read. Reads are at an absolute position and a read is atomic/thread-safe.
        Parameters:
        posn - Location of the read operation.
        b -
        start - of bytesarray to read into
        length - Maximum number of bytes to read.
        Returns:
        The number of bytes read
      • write

        default long write​(byte[] b)
        Write bytes - bytes are always written to the end of the file. Return the location where the write started.
      • write

        long write​(byte[] b,
                   int start,
                   int length)
        Write bytes - bytes are always written to the end of the file. Return the location where the write started.
      • length

        long length()
        Return the length of the file (including any buffered writes)
      • truncate

        void truncate​(long length)
        Truncate the file
      • isEmpty

        default boolean isEmpty()
        Return whether this is an empty file or not
      • sync

        void sync()
        Specified by:
        sync in interface org.apache.jena.atlas.lib.Sync
      • close

        void close()
        Specified by:
        close in interface org.apache.jena.atlas.lib.Closeable