Skip to content

Commit

Permalink
Merge 073d74d into 0f8407b
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit authored Dec 24, 2019
2 parents 0f8407b + 073d74d commit cd13b8f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ export class StreamReader {

/**
* Read ahead (peek) from stream. Subsequent read or peeks will return the same data
* @param buffer Buffer to store data read from stream in
* @param offset Offset buffer
* @param length Number of bytes to read
* @param position Source offset
* @returns {any}
* @param buffer - Buffer to store data read from stream in
* @param offset - Offset buffer
* @param length - Number of bytes to read
* @returns Number of bytes peeked
*/
public async peek(buffer: Buffer | Uint8Array, offset: number, length: number): Promise<number> {
const bytesRead = await this.read(buffer, offset, length);
Expand All @@ -70,10 +69,10 @@ export class StreamReader {

/**
* Read chunk from stream
* @param buffer Target buffer to store data read from stream in
* @param offset Offset of target buffer
* @param length Number of bytes to read
* @returns {any}
* @param buffer - Target buffer to store data read from stream in
* @param offset - Offset of target buffer
* @param length - Number of bytes to read
* @returns Number of bytes read
*/
public async read(buffer: Buffer | Uint8Array, offset: number, length: number): Promise<number> {
if (length === 0) {
Expand Down

0 comments on commit cd13b8f

Please sign in to comment.