method Socket.prototype.setEncodingSocket.prototype.setEncoding(encoding?: BufferEncoding): thisSet the encoding for the socket as a Readable Stream. See readable.setEncoding() for more information. Parametersoptionalencoding: BufferEncodingReturn TypethisThe socket itself.