java.lang.Object
org.jvnet.mimepull.DataFile
Use
RandomAccessFile
for concurrent access of read
and write partial part's content.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
close()
(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
-
Field Details
-
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 positionbuf
- that needs to be filledoffset
- the start offset of the data.length
- of data that needs to be read
-
renameTo
-
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)
-