Class DataFile

java.lang.Object
org.jvnet.mimepull.DataFile

final class DataFile extends Object
Use RandomAccessFile for concurrent access of read and write partial part's content.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private WeakDataFile
     
    private long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DataFile(File file)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
     
    (package private) void
    read(long pointer, byte[] buf, int offset, int length)
    Read data from the given file pointer position.
    (package private) void
     
    (package private) long
    writeTo(byte[] data, int offset, int length)
    Write data to the file

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • weak

      private WeakDataFile weak
    • writePointer

      private long writePointer
  • Constructor Details

    • DataFile

      DataFile(File file)
  • Method Details

    • close

      void close()
    • read

      void read(long pointer, byte[] buf, int offset, int length)
      Read data from the given file pointer position.
      Parameters:
      pointer - read position
      buf - that needs to be filled
      offset - the start offset of the data.
      length - of data that needs to be read
    • renameTo

      void renameTo(File f)
    • writeTo

      long writeTo(byte[] data, int offset, int length)
      Write data to the file
      Parameters:
      data - that needs to written to a file
      offset - start offset in the data
      length - no bytes to write
      Returns:
      file pointer before the write operation(or at which the data is written)