public interface BinaryDataFile extends org.apache.jena.atlas.lib.Closeable, org.apache.jena.atlas.lib.Sync
BinaryDataFile does not record the length and assumes the
entries are self-defining.RandomAccessFile| Modifier and Type | Method and Description |
|---|---|
void |
close() |
default boolean |
isEmpty()
Return whether this is an empty file or not
|
boolean |
isOpen()
Is it open?
|
long |
length()
Return the length of the file (including any buffered writes)
|
void |
open()
Open the file
|
default int |
read(long posn,
byte[] b)
Read into a byte array, returning the number of bytes read.
|
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
|
default long |
write(byte[] b)
Write bytes - bytes are always written to the end of the file.
|
long |
write(byte[] b,
int start,
int length)
Write bytes - bytes are always written to the end of the file.
|
void open()
boolean isOpen()
default int read(long posn,
byte[] b)
posn - Location of the read operation.b - byte arrayint read(long posn,
byte[] b,
int start,
int length)
posn - Location of the read operation.b - start - of bytesarray to read intolength - Maximum number of bytes to read.default long write(byte[] b)
long write(byte[] b,
int start,
int length)
long length()
void truncate(long length)
default boolean isEmpty()
void sync()
sync in interface org.apache.jena.atlas.lib.Syncvoid close()
close in interface org.apache.jena.atlas.lib.CloseableLicensed under the Apache License, Version 2.0