ice-dump
TypeScript icon, indicating that this package has built-in type declarations

4.3.0 • Public • Published

Ice Dump npm version Build Status

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');

Readme

Keywords

Package Sidebar

Install

npm i ice-dump

Weekly Downloads

102

Version

4.3.0

License

GPL-2.0

Unpacked Size

16.6 kB

Total Files

10

Last publish

Collaborators

  • aikoven