Classes
- name: stringNo documentation available
- buffered(): numberNo documentation available
- create(): BufReaderr: Reader,size?: number
return new BufReader unless r is BufReader
- peek(n: number): Promise<Uint8Array | null>
peek()returns the nextnbytes without advancing the reader. The bytes stop being valid at the next read call. - read(p: Uint8Array): Promise<number | null>
reads data into p. It returns the number of bytes read into p. The bytes are taken from at most one Read on the underlying Reader, hence n may be less than len(p). To read exactly len(p) bytes, use io.ReadFull(b, p).
- readByte(): Promise<number | null>
Returns the next byte [0, 255] or
null. - readFull(p: Uint8Array): Promise<Uint8Array | null>
reads exactly
p.lengthbytes intop. - readLine(): Promise<ReadLineResult | null>
readLine()is a low-level line-reading primitive. Most callers should usereadString('\n')instead or use a Scanner. - readSlice(delim: number): Promise<Uint8Array | null>
readSlice()reads until the first occurrence ofdelimin the input, returning a slice pointing at the bytes in the buffer. The bytes stop being valid at the next read. - readString(delim: string): Promise<string | null>
readString() reads until the first occurrence of delim in the input, returning a string containing the data up to and including the delimiter. If ReadString encounters an error before finding a delimiter, it returns the data read before the error and the error itself (often
null). ReadString returns err !== null if and only if the returned data does not end in delim. For simple uses, a Scanner may be more convenient. - reset(r: Reader): void
Discards any buffered data, resets all state, and switches the buffered reader to read from r.
- size(): number
Returns the size of the underlying buffer in bytes.
Interfaces
Result type returned by of BufReader.readLine().