A Content. that provides the file content of the passed Path.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final ByteBufferPool | |
| private SeekableByteChannel | |
| private Runnable | |
| private Content. | |
| private final SerializedInvoker | |
| private final long | |
| private final AutoLock | |
| private final Path | |
| private long | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | demand(Runnable
the demand callback to invoke where there is a content chunk available demandCallback)Implements org. Demands to invoke the given demand callback parameter when a chunk of content is available. |
| public void | fail(Throwable
the cause of the failure failure)Implements org. Fails this content source with a |
| private Content. | |
| public int | |
| public long | |
| public Path | |
| private void | |
| protected boolean | |
| public boolean | |
| protected SeekableByteChannel | |
| public Content. | |
| protected int | |
| public boolean | rewind()
Overrides default org. Rewinds this content, if possible, so that subsequent reads return chunks starting from the beginning of this content. |
| private void | |
| public void | |
| public void |
| bufferSize | back to summary |
|---|---|
| private int bufferSize | |
| byteBufferPool | back to summary |
|---|---|
| private final ByteBufferPool byteBufferPool | |
| channel | back to summary |
|---|---|
| private SeekableByteChannel channel | |
| demandCallback | back to summary |
|---|---|
| private Runnable demandCallback | |
| errorChunk | back to summary |
|---|---|
| private Content. | |
| invoker | back to summary |
|---|---|
| private final SerializedInvoker invoker | |
| length | back to summary |
|---|---|
| private final long length | |
| lock | back to summary |
|---|---|
| private final AutoLock lock | |
| path | back to summary |
|---|---|
| private final Path path | |
| totalRead | back to summary |
|---|---|
| private long totalRead | |
| useDirectByteBuffers | back to summary |
|---|---|
| private boolean useDirectByteBuffers | |
| PathContentSource | back to summary |
|---|---|
| public PathContentSource(Path path) | |
| PathContentSource | back to summary |
|---|---|
| public PathContentSource(Path path, ByteBufferPool byteBufferPool) | |
| demand | back to summary |
|---|---|
| public void demand(Runnable demandCallback) Implements org. Doc from org. Demands to invoke the given demand callback parameter when a chunk of content is available. See how to use this method idiomatically. Implementations guarantee that calls to this method are safely reentrant so that
stack overflows are avoided in the case of mutual recursion between the execution of
the The demand callback may be invoked spuriously: a subsequent call to Calling this method establishes a pending demand, which is fulfilled when the demand callback is invoked. Calling this method when there is already a pending demand results in an
If the invocation of the demand callback throws an exception, then | |
| fail | back to summary |
|---|---|
| public void fail(Throwable failure) Implements org. Doc from org. Fails this content source with a The failure may be notified to the content reader at a later time, when
the content reader reads a content chunk, via a If Typical failure: the content being aborted by user code, or idle timeouts. If this method has already been called, then it is a no operation. | |
| failure | back to summary |
|---|---|
| private Content. | |
| getBufferSize | back to summary |
|---|---|
| public int getBufferSize() | |
| getLength | back to summary |
|---|---|
| public long getLength() Overrides default org.
| |
| getPath | back to summary |
|---|---|
| public Path getPath() | |
| invokeDemandCallback | back to summary |
|---|---|
| private void invokeDemandCallback() | |
| isReadComplete | back to summary |
|---|---|
| protected boolean isReadComplete(long read) | |
| isUseDirectByteBuffers | back to summary |
|---|---|
| public boolean isUseDirectByteBuffers() | |
| open | back to summary |
|---|---|
| protected SeekableByteChannel open() throws IOException | |
| read | back to summary |
|---|---|
| public Content. Implements org. Doc from org. Reads a chunk of content. See how to use this method idiomatically. The returned chunk could be:
Once a read returns an Once a read returns a The content reader code must ultimately arrange for a call to
Additionally, prior to the ultimate call to Concurrent reads from different threads are not recommended, as they are inherently in a race condition. Reads performed outside the invocation context of a
| |
| read | back to summary |
|---|---|
| protected int read(SeekableByteChannel channel, ByteBuffer byteBuffer) throws IOException | |
| rewind | back to summary |
|---|---|
| public boolean rewind() Overrides default org. Doc from org. Rewinds this content, if possible, so that subsequent reads return chunks starting from the beginning of this content.
| |
| runDemandCallback | back to summary |
|---|---|
| private void runDemandCallback(Runnable demandCallback) | |
| setBufferSize | back to summary |
|---|---|
| public void setBufferSize(int bufferSize) | |
| setUseDirectByteBuffers | back to summary |
|---|---|
| public void setUseDirectByteBuffers(boolean useDirectByteBuffers) | |