hphp/hack/manual/hsl/Classes/HH.Lib.IO/BufferedReader/index.md
:::info[Note] This is a point-in-time snapshot of the API documentation from January 2026. Going forward, we will not be maintaining a public copy of these references, and recommend users to refer to the built-in signature helpers available in the Hack LSP instead for complete and up-to-date information. :::
Wrapper for ReadHandles, with buffered line-based byte-based accessors
readLineAsync() is similar to fgets()readUntilAsync() is a more general formreadByteAsync() is similar to fgetc()namespace HH\Lib\IO;
final class BufferedReader implements ReadHandle {...}
->__construct(ReadHandle $handle)->getHandle(): ReadHandle->isEndOfFile(): bool->linesIterator(): AsyncIterator<string>->readAllowPartialSuccessAsync(?int $max_bytes = NULL, ?int $timeout_ns = NULL): Awaitable<string>->readByteAsync(?int $timeout_ns = NULL): Awaitable<string>->readFixedSizeAsync(int $size, ?int $timeout_ns = NULL): Awaitable<string>->readImpl(?int $max_bytes = NULL): string->readLineAsync(): Awaitable<?string>->readLinexAsync(): Awaitable<string>->readUntilAsync(string $suffix): Awaitable<?string>->readUntilxAsync(string $suffix): Awaitable<string>HH\Lib\IO\ReadHandle)->readAllAsync(?int $max_bytes = NULL, ?int $timeout_ns = NULL): Awaitable<string>