public class BinaryDataFileWriteBuffered extends Object implements BinaryDataFile
BinaryDataFile adding write buffering to another
BinaryDataFile file, such as a BinaryDataFileRandomAccess.
| Constructor and Description |
|---|
BinaryDataFileWriteBuffered(BinaryDataFile other) |
BinaryDataFileWriteBuffered(BinaryDataFile other,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
isOpen()
Is it open?
|
long |
length()
Return the length of the file (including any buffered writes)
|
void |
open()
Open the file
|
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 posn)
Truncate the file
|
long |
write(byte[] buf,
int off,
int len)
Write bytes - bytes are always written to the end of the file.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisEmpty, read, writepublic BinaryDataFileWriteBuffered(BinaryDataFile other)
public BinaryDataFileWriteBuffered(BinaryDataFile other, int bufferSize)
public void open()
BinaryDataFileopen in interface BinaryDataFilepublic void close()
close in interface org.apache.jena.atlas.lib.Closeableclose in interface BinaryDataFilepublic boolean isOpen()
BinaryDataFileisOpen in interface BinaryDataFilepublic long length()
BinaryDataFilelength in interface BinaryDataFilepublic void truncate(long posn)
BinaryDataFiletruncate in interface BinaryDataFilepublic int read(long posn,
byte[] b,
int start,
int length)
BinaryDataFileread in interface BinaryDataFileposn - Location of the read operation.start - of bytesarray to read intolength - Maximum number of bytes to read.public long write(byte[] buf,
int off,
int len)
BinaryDataFilewrite in interface BinaryDataFilepublic void sync()
sync in interface org.apache.jena.atlas.lib.Syncsync in interface BinaryDataFileLicensed under the Apache License, Version 2.0