public class BinaryDataFileRandomAccess extends Object implements BinaryDataFile
BinaryDataFile using RandomAccessFile.
BinaryDataFileWriteBuffered| Constructor and Description |
|---|
BinaryDataFileRandomAccess(String filename) |
| 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 length)
Truncate the file
|
long |
write(byte[] b,
int start,
int length)
Write bytes - bytes are always written to the end of the file.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisEmpty, read, writepublic BinaryDataFileRandomAccess(String filename)
public void open()
BinaryDataFileopen in interface BinaryDataFilepublic boolean isOpen()
BinaryDataFileisOpen 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[] b,
int start,
int length)
BinaryDataFilewrite in interface BinaryDataFilepublic void truncate(long length)
BinaryDataFiletruncate in interface BinaryDataFilepublic void sync()
sync in interface org.apache.jena.atlas.lib.Syncsync in interface BinaryDataFilepublic void close()
close in interface org.apache.jena.atlas.lib.Closeableclose in interface BinaryDataFilepublic long length()
BinaryDataFilelength in interface BinaryDataFileLicensed under the Apache License, Version 2.0