readByte method

Future<int> readByte()

Reads a signed byte. Returns an int between -128 and 127, inclusive. See also readUnsignedByte.

Throws EOFException if EOF is reached before the needed byte is read.

Implementation

Future<int> readByte() async {
  final b = await readUnsignedByte();
  if (b & 0x80 != 0) {
    return b - 0x100;
  } else {
    return b;
  }
}