Package i2p.susi.util

Class FileBuffer

  • All Implemented Interfaces:
    Buffer
    Direct Known Subclasses:
    GzipFileBuffer

    public class FileBuffer
    extends Object
    implements Buffer
    File implementation of Buffer.
    Since:
    0.9.34
    • Field Detail

      • _file

        protected final File _file
      • _offset

        protected final int _offset
      • _sublen

        protected final int _sublen
    • Constructor Detail

      • FileBuffer

        public FileBuffer​(File file)
      • FileBuffer

        public FileBuffer​(File file,
                          int offset,
                          int sublen)
    • Method Detail

      • getFile

        public File getFile()
        Returns:
        the underlying file
      • readComplete

        public void readComplete​(boolean success)
        Description copied from interface: Buffer
        Top-level reader MUST call this to close the input stream.
        Specified by:
        readComplete in interface Buffer
      • writeComplete

        public void writeComplete​(boolean success)
        Deletes the file if success is false
        Specified by:
        writeComplete in interface Buffer
        Parameters:
        success - if false, deletes any resources
      • getLength

        public int getLength()
        Always valid if file exists
        Specified by:
        getLength in interface Buffer
      • getOffset

        public int getOffset()
        Always valid
        Specified by:
        getOffset in interface Buffer