writeLengthCodedBinary method

void writeLengthCodedBinary(
  1. int value
)

Will write a length coded binary value, once implemented!

Implementation

void writeLengthCodedBinary(int value) {
  if (value < 251) {
    writeByte(value);
    return;
  }
  if (value < (2 << 15)) {
    writeByte(0xfc);
    writeUint16(value);
    return;
  }
  if (value < (2 << 23)) {
    writeByte(0xfd);
    writeUint24(value);
    return;
  }
  if (value < (2 << 63)) {
    writeByte(0xfe);
    writeUint64(value);
  }
}