Class IBufferList

Hierarchy

Index

Properties

Methods

Properties

public encoding: string

public length: number

Methods

public addListener(event: string, listener: () => void): IBufferList

Parameters

  • event: string
  • listener: () => void

Returns

IBufferList

public addListener(event: "'advance'", cb: (n: number) => void): IBufferList

Parameters

  • event: "'advance'"
  • cb: (n: number) => void

Returns

IBufferList

public addListener(event: "'write'", cb: (buf: Buffer) => void): IBufferList

Parameters

  • event: "'write'"
  • cb: (buf: Buffer) => void

Returns

IBufferList

public advance(n: number): IBufferList

Advance the buffer stream by n bytes. If n the aggregate advance offset passes the end of the buffer list, operations such as take will return empty strings until enough data is pushed.

Parameters

  • n: number

Returns

IBufferList

public emit(event: string, args?: Array<any>): boolean

Parameters

  • event: string
  • args?: Array<any> optional

Returns

boolean

public end(buf: Buffer)

Parameters

public forEach(fn: (buf: Buffer) => boolean)

For each buffer, perform some action. If fn's result is a true value, cut out early.

Parameters

  • fn: (buf: Buffer) => boolean

public join(start: number, end: number): Buffer

Create a single buffer out of all the chunks

Parameters

  • start: number
  • end: number

Returns

Buffer

public joinInto(buf: Buffer, offset: number, start: number, end: number): Buffer

Join all the chunks to existing buffer

Parameters

  • buf: Buffer
  • offset: number
  • start: number
  • end: number

Returns

Buffer

public listeners(event: string): Array<Function>

Parameters

  • event: string

Returns

Array<Function>

public on(event: string, listener: () => void): IBufferList

Parameters

  • event: string
  • listener: () => void

Returns

IBufferList

public on(event: "'advance'", cb: (n: number) => void): IBufferList

Parameters

  • event: "'advance'"
  • cb: (n: number) => void

Returns

IBufferList

public on(event: "'write'", cb: (buf: Buffer) => void): IBufferList

Parameters

  • event: "'write'"
  • cb: (buf: Buffer) => void

Returns

IBufferList

public once(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public removeAllListeners(event?: string): EventEmitter

Parameters

  • event?: string optional

Returns

EventEmitter

public removeListener(event: string, listener: Function): EventEmitter

Parameters

  • event: string
  • listener: Function

Returns

EventEmitter

public setMaxListeners(n: number)

Parameters

  • n: number

public take(n: number, encoding?: string): any

Take n bytes from the start of the buffers. If there are less than n bytes in all the buffers or n is undefined, returns the entire concatenated buffer string.

Parameters

  • n: number
  • encoding?: string optional

Returns

any

public take(encoding?: string): any

Parameters

  • encoding?: string optional

Returns

any

public write(buf: Buffer): boolean

Parameters

Returns

boolean