README
Ice Dump
Encode and decode ZeroC Ice values manually into Ice binary format.
Installation
npm install ice-dump
Usage
Serializing instances of Ice.Value:
import {valueToBuffer, bufferToValue} from 'ice-dump';
const buffer = valueToBuffer(iceValue); // Uint8Array
const readValue = bufferToValue(buffer);
Using Sliced format:
import {Ice} from 'ice';
const buffer = valueToBuffer(iceValue, Ice.FormatType.SlicedFormat);
If you need to deal with proxies, pass Communicator
as a second parameter to
bufferToValue
.
To serialize structs, sequences or dictionaries you must provide Ice type name
in form MyModule.MySeq
or ::MyModule::MySeq
:
import {iceToBuffer, bufferToIce} from 'ice-dump';
const buffer = iceToBuffer(sequence, 'MyModule.MySeq'); // Uint8Array
const readSequence = bufferToIce(buffer, 'MyModule.MySeq');