MsgPack format encoder.

Constructor

new(output:Output)

Parameters:

output

Instance to write the encoded MsgPack data. Property bigEndian will be set true.

Variables

@:value(true)compactFloat:Bool = true

Whether to check if Float can fit within 32-bits.

Set to false to reduce a few CPU cycles at the cost of slightly larger output size.

read onlyoutput:Output

Current output instance.

Methods

dynamiccustomEncoder(encoder:Encoder, object:Any):Void

A callback which will be called when an object cannot be encoded by the encoder itself.

encode(value:Any):Void

Recursively encode the given object.

@:nullSafety(Off)inlineencodeAnonStruct(doc:DynamicAccess<Any>):Void

encodeArray(value:Array<Any>):Void

inlineencodeBool(value:Bool):Void

@:value({ pos : 0 })encodeBytes(value:Bytes, pos:Int = 0, ?length:Int):Void

@:value({ pos : 0 })encodeExtension(type:Int, value:Bytes, pos:Int = 0, ?length:Int):Void

inlineencodeFloat(value:Float):Void

encodeInt(value:Int):Void

encodeInt64(value:Int64):Void

encodeMap<K, V>(map:IMap<K, V>):Void

encodeMapArrays<K, V>(keys:Array<K>, values:Array<V>):Void

inlineencodeNull():Void

encodeString(value:String):Void

reset(output:Output):Void

Reset the encoder for reuse.