<virtual> new Pair()
Constructs a new abstract PSON encoder and decoder pair.
Methods
-
decode(pson) → {*}
-
Decodes PSON to JSON.
Parameters:
Name Type Description pson
ByteBuffer | ArrayBuffer | Buffer PSON
Returns:
JSON
- Type
- *
-
encode(json) → {ByteBuffer}
-
Encodes JSON to PSON.
Parameters:
Name Type Description json
* JSON
Returns:
PSON
- Type
- ByteBuffer
-
toArrayBuffer(json) → {ArrayBuffer}
-
Encodes JSON straight to an ArrayBuffer of PSON.
Parameters:
Name Type Description json
* JSON
Returns:
PSON as ArrayBuffer
- Type
- ArrayBuffer
-
toBuffer(json) → {Buffer}
-
Encodes JSON straight to a node Buffer of PSON.
Parameters:
Name Type Description json
* JSON
Returns:
PSON as node Buffer
- Type
- Buffer