public class BufferedReadableCharacterStreamLocation extends ConcurrentCloseable<IOException> implements ICharacterStream.Readable.Buffered, ICharacterStream.Readable.PositionInText
ICharacterStream.Readable.Buffered, ICharacterStream.Readable.PositionInTextICharacterStream.Readable, ICharacterStream.Writable, ICharacterStream.WriterAsyncCloseableListenable.Impl| Constructor and Description |
|---|
BufferedReadableCharacterStreamLocation(ICharacterStream.Readable.Buffered stream)
Constructor.
|
BufferedReadableCharacterStreamLocation(ICharacterStream.Readable.Buffered stream,
int line,
int posInLine)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
back(char c)
Put back one character.
|
IAsync<IOException> |
canStartReading()
Return a synchronization point which is unblocked once some characters have been buffered.
|
protected void |
closeResources(Async<IOException> ondone) |
protected IAsync<IOException> |
closeUnderlyingResources() |
boolean |
endReached()
Return true if the end of the stream has been reached, and no more character can be read.
|
String |
getDescription()
Description.
|
Charset |
getEncoding()
Return the encoding of the stream.
|
int |
getLine()
Return the current line number.
|
int |
getPositionInLine()
Return the current column number in line.
|
byte |
getPriority()
Return the priority.
|
char |
read()
Read one character.
|
int |
readAsync()
Read one character if possible.
|
AsyncSupplier<Integer,IOException> |
readAsync(char[] buf,
int offset,
int length)
Read characters.
|
UnprotectedString |
readNextBuffer()
Return the next buffer, or null if the end of stream has been reached.
|
AsyncSupplier<UnprotectedString,IOException> |
readNextBufferAsync()
Return the next buffer as soon as available, or null if then end of stream has been reached.
|
int |
readSync(char[] buf,
int offset,
int length)
Read characters.
|
boolean |
readUntil(char endChar,
UnprotectedStringBuffer string)
Read characters until the given end, and put them in the given string.
|
AsyncSupplier<Boolean,IOException> |
readUntilAsync(char endChar,
UnprotectedStringBuffer string)
Read characters until the given end, and put them in the given string.
|
void |
setPriority(byte priority)
Change the priority (see Task priorities).
|
addCloseListener, addCloseListener, close, closeAsync, isClosed, isClosing, lockClose, operation, operation, removeCloseListener, removeCloseListener, unlockCloseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadFullyAsync, readFullySynclockClose, unlockCloseclosecloseAfter, closeAsyncaddCloseListener, addCloseListener, close, isClosed, removeCloseListener, removeCloseListenerpublic BufferedReadableCharacterStreamLocation(ICharacterStream.Readable.Buffered stream)
public BufferedReadableCharacterStreamLocation(ICharacterStream.Readable.Buffered stream, int line, int posInLine)
public int getLine()
ICharacterStream.Readable.PositionInTextgetLine in interface ICharacterStream.Readable.PositionInTextpublic int getPositionInLine()
ICharacterStream.Readable.PositionInTextgetPositionInLine in interface ICharacterStream.Readable.PositionInTextprotected IAsync<IOException> closeUnderlyingResources()
closeUnderlyingResources in class ConcurrentCloseable<IOException>protected void closeResources(Async<IOException> ondone)
closeResources in class ConcurrentCloseable<IOException>public String getDescription()
ICharacterStreamgetDescription in interface ICharacterStreampublic Charset getEncoding()
ICharacterStreamgetEncoding in interface ICharacterStreampublic byte getPriority()
ConcurrentCloseablegetPriority in interface ICharacterStreamgetPriority in class ConcurrentCloseable<IOException>public void setPriority(byte priority)
ICharacterStreamsetPriority in interface ICharacterStreampublic char read()
throws IOException
ICharacterStream.Readable.Bufferedread in interface ICharacterStream.Readable.BufferedIOExceptionpublic int readSync(char[] buf,
int offset,
int length)
throws IOException
ICharacterStream.ReadablereadSync in interface ICharacterStream.ReadableIOExceptionpublic void back(char c)
ICharacterStream.Readable.Bufferedback in interface ICharacterStream.Readable.Bufferedpublic int readAsync()
throws IOException
ICharacterStream.Readable.BufferedreadAsync in interface ICharacterStream.Readable.BufferedIOExceptionpublic AsyncSupplier<Integer,IOException> readAsync(char[] buf, int offset, int length)
ICharacterStream.ReadablereadAsync in interface ICharacterStream.Readablepublic AsyncSupplier<UnprotectedString,IOException> readNextBufferAsync()
ICharacterStream.Readable.BufferedreadNextBufferAsync in interface ICharacterStream.Readable.Bufferedpublic UnprotectedString readNextBuffer() throws IOException
ICharacterStream.Readable.BufferedreadNextBuffer in interface ICharacterStream.Readable.BufferedIOExceptionpublic boolean readUntil(char endChar,
UnprotectedStringBuffer string)
throws IOException
ICharacterStream.Readable.BufferedreadUntil in interface ICharacterStream.Readable.BufferedIOExceptionpublic AsyncSupplier<Boolean,IOException> readUntilAsync(char endChar, UnprotectedStringBuffer string)
ICharacterStream.Readable.BufferedreadUntilAsync in interface ICharacterStream.Readable.Bufferedpublic boolean endReached()
ICharacterStream.ReadableendReached in interface ICharacterStream.Readablepublic IAsync<IOException> canStartReading()
ICharacterStream.Readable.BufferedcanStartReading in interface ICharacterStream.Readable.BufferedCopyright © 2019. All rights reserved.