this.context=(optionsas{context: ContextType}|undefined)?.contextasContextType;// needs a type assertion because EncoderOptions has no context property when ContextType is undefined
* This is almost equivalent to {@link Encoder#encode}, but it returns an reference of the encoder's internal buffer and thus much faster than {@link Encoder#encode}.
*
* @returns Encodes the object and returns a shared reference the encoder's internal buffer.