BlockSource implementations must decide if they will be thread-safe,
or not.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | adviseSequentialRead(long
starting position. startPos, long ending position. endPos)Advise the |
| public abstract void | close()
Redeclares java. Closes this resource, relinquishing any underlying resources. |
| public static BlockSource | Returns: block source to read fromcontent.input file. content)Wrap a byte array as a |
| public static BlockSource | Returns: wrapper forin.the file. The in)BlockSource will close in.Read from a |
| public static BlockSource | Returns: wrapper forch.the file. The ch)BlockSource will close ch.Read from a |
| public abstract ByteBuffer | Returns: buffer containing the block content.position of the block in the file, specified in bytes from the
beginning of the file. position, int size to read. blockSize)Read a block from the file. |
| public abstract long |
| BlockSource | back to summary |
|---|---|
| public BlockSource() | |
| adviseSequentialRead | back to summary |
|---|---|
| public void adviseSequentialRead(long startPos, long endPos) Advise the
| |
| close | back to summary |
|---|---|
| public abstract void close() Redeclares java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
| |
| from | back to summary |
|---|---|
| public static BlockSource from(byte[] content) Wrap a byte array as a
| |
| from | back to summary |
|---|---|
| public static BlockSource from(FileInputStream in) Read from a
The returned
| |
| from | back to summary |
|---|---|
| public static BlockSource from(FileChannel ch) Read from a
The returned
| |
| read | back to summary |
|---|---|
| public abstract ByteBuffer read(long position, int blockSize) throws IOException Read a block from the file.
To reduce copying, the returned ByteBuffer should have an accessible
array and
| |
| size | back to summary |
|---|---|
| public abstract long size() throws IOException Determine the size of the file.
| |