chromium_pickle 1.0.2 chromium_pickle: ^1.0.2 copied to clipboard
This library ports Chromium's Pickle class to Dart and provides facilities for basic binary value packing and unpacking.
import 'package:chromium_pickle/chromium_pickle.dart';
void main() {
// Create empty pickle
var pickle = Pickle.empty();
// Write value to pickle
pickle.writeInt(1024);
// Create iterator
var iterator = pickle.createIterator();
// Read value
print(iterator.readInt());
// Dump pickle to Uint8List
var pickleData = pickle.toUint8List();
// Create new pickle from Uint8List
var newIterator = Pickle.fromUint8List(pickleData).createIterator();
// There is it again!
print(newIterator.readInt());
}