public interface Cursor extends Closeable
InputStream
(although such implementation exists), but instead consider a conceptual stream, regardless of its nature.
It works by adding the concept of a zero-based position. Each position
represents one byte in the stream. Each time data is pulled from this stream,
the position advances as many bytes as read. However, the seek(long)
method can be used to reset the position.
Implementations should not be expected to be thread safe. Should not be used concurrently.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
For a Cursor, to be closed means that this cursor should not provide any more data.
|
long |
getPosition() |
CursorProvider |
getProvider() |
boolean |
isReleased() |
void |
release()
Releases all the resources that
this cursor allocated. |
void |
seek(long position)
Updates the cursor's position.
|
long getPosition()
void seek(long position) throws IOException
position - the new positionIOExceptionvoid release()
this cursor allocated.
Implementation of this method must be idempotent and thread-safe.
This method should only be called by the Runtime. Once that happens,
the isReleased() method will start to return true
boolean isReleased()
release() method has been called on this instanceCursorProvider getProvider()
CursorProvider which generated this cursorvoid close()
throws IOException
release() method is for.
Depending on the concrete cursor type, closed cursors might be re-opened or not.close in interface AutoCloseableclose in interface CloseableIOExceptionCopyright © 2017 MuleSoft, Inc.. All rights reserved.