When stream.setEncoding is called, it additionally sets the decoder in the underlying stream. Unfortunately, despite what the official documentation says, calling setEncoding(null) sets the underlying decoder to UTF-8.
This causes problems when you need the raw buffer data of a file to pipe elsewhere, such as a zlib.gunzip stream for gunzipping files.
This pull request allows specifying { encoding: null } to disable that call.
When stream.setEncoding is called, it additionally sets the decoder in the underlying stream. Unfortunately, despite what the official documentation says, calling
setEncoding(null)
sets the underlying decoder to UTF-8.This causes problems when you need the raw buffer data of a file to pipe elsewhere, such as a zlib.gunzip stream for gunzipping files.
This pull request allows specifying
{ encoding: null }
to disable that call.