writeLengthCodedBinary method

void writeLengthCodedBinary(
  1. int value
)

Will write a length coded binary value, once implemented!

Implementation

void writeLengthCodedBinary(int value) {
  if (value < 251) {
    byte = value;
    return;
  }
  if (value < (2 << 15)) {
    byte = 0xfc;
    uint16 = value;
    return;
  }
  if (value < (2 << 23)) {
    byte = 0xfd;
    uint24 = value;
    return;
  }
  if (value < (2 << 63)) {
    byte = 0xfe;
    uint64 = value;
  }
}