@staticmethod
def test_binary_writer_reader():
    data = b'\x01\x05\x00\x00\x00\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x88A\x00\x00\x00\x00\x00\x009@\x1a\x1b\x1c\x1d\x1e\x1f \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80'
    with BinaryReader(data) as reader:
        value = reader.read_byte()
        assert (value == 1), 'Example byte should be 1 but is {}'.format(value)
        value = reader.read_int()
        assert (value == 5), 'Example integer should be 5 but is {}'.format(value)
        value = reader.read_long()
        assert (value == 13), 'Example long integer should be 13 but is {}'.format(value)
        value = reader.read_float()
        assert (value == 17.0), 'Example float should be 17.0 but is {}'.format(value)
        value = reader.read_double()
        assert (value == 25.0), 'Example double should be 25.0 but is {}'.format(value)
        value = reader.read(7)
        assert (value == bytes([26, 27, 28, 29, 30, 31, 32])), 'Example bytes should be {} but is {}'.format(bytes([26, 27, 28, 29, 30, 31, 32]), value)
        value = reader.read_large_int(128, signed=False)
        assert (value == (2 ** 127)), 'Example large integer should be {} but is {}'.format((2 ** 127), value)
@staticmethod
def test_binary_writer_reader():
    data = b'\x01\x05\x00\x00\x00\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x88A\x00\x00\x00\x00\x00\x009@\x1a\x1b\x1c\x1d\x1e\x1f \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80'
    with BinaryReader(data) as reader:
        value = reader.read_byte()
        assert (value == 1), 'Example byte should be 1 but is {}'.format(value)
        value = reader.read_int()
        assert (value == 5), 'Example integer should be 5 but is {}'.format(value)
        value = reader.read_long()
        assert (value == 13), 'Example long integer should be 13 but is {}'.format(value)
        value = reader.read_float()
        assert (value == 17.0), 'Example float should be 17.0 but is {}'.format(value)
        value = reader.read_double()
        assert (value == 25.0), 'Example double should be 25.0 but is {}'.format(value)
        value = reader.read(7)
        assert (value == bytes([26, 27, 28, 29, 30, 31, 32])), 'Example bytes should be {} but is {}'.format(bytes([26, 27, 28, 29, 30, 31, 32]), value)
        value = reader.read_large_int(128, signed=False)
        assert (value == (2 ** 127)), 'Example large integer should be {} but is {}'.format((2 ** 127), value)