Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StringDecoder

Hierarchy

  • StringDecoder

Index

Constructors

Methods

Constructors

constructor

Methods

end

  • end(buffer?: Buffer): string
  • Returns any remaining input stored in the internal buffer as a string. Bytes representing incomplete UTF-8 and UTF-16 characters will be replaced with substitution characters appropriate for the character encoding.

    If the buffer argument is provided, one final call to stringDecoder.write() is performed before returning the remaining input.

    Parameters

    • Optional buffer: Buffer

      A Buffer containing the bytes to decode.

    Returns string

write

  • write(buffer: Buffer): string
  • Returns a decoded string, ensuring that any incomplete multibyte characters at the end of the Buffer are omitted from the returned string and stored in an internal buffer for the next call to stringDecoder.write() or stringDecoder.end().

    Parameters

    • buffer: Buffer

      A Buffer containing the bytes to decode.

    Returns string

Generated using TypeDoc