- java.lang.Object
-
- org.jvnet.mimepull.DataFile
-
final class DataFile extends java.lang.ObjectUseRandomAccessFilefor concurrent access of read and write partial part's content.
-
-
Field Summary
Fields Modifier and Type Field Description private WeakDataFileweakprivate longwritePointer
-
Constructor Summary
Constructors Constructor Description DataFile(java.io.File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidclose()(package private) voidread(long pointer, byte[] buf, int offset, int length)Read data from the given file pointer position.(package private) voidrenameTo(java.io.File f)(package private) longwriteTo(byte[] data, int offset, int length)Write data to the file
-
-
-
Field Detail
-
weak
private WeakDataFile weak
-
writePointer
private long writePointer
-
-
Method Detail
-
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 positionbuf- that needs to be filledoffset- the start offset of the data.length- of data that needs to be read
-
renameTo
void renameTo(java.io.File f)
-
writeTo
long writeTo(byte[] data, int offset, int length)Write data to the file- Parameters:
data- that needs to written to a fileoffset- start offset in the datalength- no bytes to write- Returns:
- file pointer before the write operation(or at which the data is written)
-
-