public class BufferedReverseIOReading extends ConcurrentCloseable<IOException> implements IO.ReadableByteStream
IO.KnownSize, IO.OperationType, IO.OutputToInput, IO.PositionKnown, IO.Readable, IO.ReadableByteStream, IO.Resizable, IO.Seekable, IO.Writable, IO.WritableByteStream, IO.WriterAsyncCloseableListenable.Impl| Constructor and Description |
|---|
BufferedReverseIOReading(T io,
int bufferSize)
Create an IO capable to read bytes backward from a Seekable.
|
| Modifier and Type | Method and Description |
|---|---|
Async<IOException> |
canStartReading()
Return a synchronization point that is unblocked when data is ready to be read.
|
protected void |
closeResources(Async<IOException> ondone) |
protected IAsync<IOException> |
closeUnderlyingResources() |
byte |
getPriority()
Return the priority.
|
long |
getSize() |
String |
getSourceDescription()
Describe the IO, which can be used for logging or debugging purposes.
|
TaskManager |
getTaskManager()
Return the TaskManager used for asynchronous operations.
|
IO |
getWrappedIO()
If this IO is wrapping another one (such as adding Buffered capabilities), this method returns it,
or null if it does not wrap another IO.
|
int |
read()
Read next byte.
|
int |
read(byte[] buffer,
int offset,
int len)
Read bytes into the given buffer, starting to store them at the given offset, and with the given maximum number of bytes.
|
int |
readFully(byte[] buffer)
Read bytes to fill the given buffer, and return the number of bytes read which is less than the
size of the buffer only if the end of the IO is reached, and so may return 0.
|
int |
readReverse()
Read a byte backward.
|
void |
setPriority(byte priority)
Set the priority of asynchronous operations.
|
int |
skip(int skip)
Same as
IO.Readable.skipSync(long) but limited to an integer. |
void |
stop()
Try to stop any pending read operation on the underlying IO, and wait them to end.
|
addCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadBytecancelClosed, error, errorCancelledlockClose, unlockCloseclosecloseAfter, closeAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerpublic BufferedReverseIOReading(T io,
int bufferSize)
public Async<IOException> canStartReading()
IO.ReadableByteStreamcanStartReading in interface IO.ReadableByteStreampublic void stop()
public long getSize()
public byte getPriority()
ConcurrentCloseablegetPriority in interface IOgetPriority in class ConcurrentCloseable<IOException>public void setPriority(byte priority)
IOsetPriority in interface IOpublic IO getWrappedIO()
IOgetWrappedIO in interface IOpublic String getSourceDescription()
IOgetSourceDescription in interface IOpublic TaskManager getTaskManager()
IOgetTaskManager in interface IOprotected IAsync<IOException> closeUnderlyingResources()
closeUnderlyingResources in class ConcurrentCloseable<IOException>protected void closeResources(Async<IOException> ondone)
closeResources in class ConcurrentCloseable<IOException>public int readReverse()
throws IOException
IOExceptionpublic int read()
throws IOException
IO.ReadableByteStreamread in interface IO.ReadableByteStreamIOExceptionpublic int read(byte[] buffer,
int offset,
int len)
throws IOException
IO.ReadableByteStreamread in interface IO.ReadableByteStreamIOExceptionpublic int readFully(byte[] buffer)
throws IOException
IO.ReadableByteStreamreadFully in interface IO.ReadableByteStreamIOExceptionpublic int skip(int skip)
throws IOException
IO.ReadableByteStreamIO.Readable.skipSync(long) but limited to an integer.skip in interface IO.ReadableByteStreamIOExceptionCopyright © 2019. All rights reserved.