HH\Lib\IO\BufferedReader
Wrapper for ReadHandle
s, with buffered line-based byte-based accessors
readLineAsync()
is similar tofgets()
readUntilAsync()
is a more general formreadByteAsync()
is similar tofgetc()
Interface Synopsis
namespace HH\Lib\IO;
final class BufferedReader implements ReadHandle {...}
Public Methods
->__construct(ReadHandle $handle)
->getHandle(): ReadHandle
->isEndOfFile(): bool
If we are known to have reached the end of the file->linesIterator(): AsyncIterator<string>
Iterate over all lines in the file->readAllowPartialSuccessAsync(?int $max_bytes = NULL, ?int $timeout_ns = NULL): Awaitable<string>
->readByteAsync(?int $timeout_ns = NULL): Awaitable<string>
Read a single byte from the handle->readFixedSizeAsync(int $size, ?int $timeout_ns = NULL): Awaitable<string>
->readImpl(?int $max_bytes = NULL): string
->readLineAsync(): Awaitable<?string>
Read until the platform end-of-line sequence is seen, or EOF is reached->readLinexAsync(): Awaitable<string>
Read a line or throw EPIPE->readUntilAsync(string $suffix): Awaitable<?string>
Read until the specified suffix is seen->readUntilxAsync(string $suffix): Awaitable<string>
Read until the suffix, or raise EPIPE if the separator is not seen
Public Methods (HH\Lib\IO\ReadHandle
)
->readAllAsync(?int $max_bytes = NULL, ?int $timeout_ns = NULL): Awaitable<string>
Read until there is no more data to read