@Test
public void testWriteRawVarInt32Bytes() throws IOException
{

    ByteArrayOutputStream testOutput = new ByteArrayOutputStream();
    ProtobufOutput.writeRawVarInt32Bytes(testOutput, 0x00000001);
    Assert.assertArrayEquals(new byte[]{1}, testOutput.toByteArray());
    testOutput.reset();
    ProtobufOutput.writeRawVarInt32Bytes(testOutput, 0x01010101);
    Assert.assertArrayEquals(new byte[]{-127, -126, -124, 8}, testOutput.toByteArray());
    testOutput.reset();
    ProtobufOutput.writeRawVarInt32Bytes(testOutput, 0xFFFFFF00);
    Assert.assertArrayEquals(new byte[]{-128, -2, -1, -1, 15}, testOutput.toByteArray());
    testOutput.reset();
    DataOutput testDataOutput = new DataOutputStream(testOutput);
    ProtobufOutput.writeRawVarInt32Bytes(testDataOutput, 0x00000001);
    Assert.assertArrayEquals(new byte[]{1}, testOutput.toByteArray());
    testOutput.reset();
    ProtobufOutput.writeRawVarInt32Bytes(testDataOutput, 0x01010101);
    Assert.assertArrayEquals(new byte[]{-127, -126, -124, 8}, testOutput.toByteArray());
    testOutput.reset();
    ProtobufOutput.writeRawVarInt32Bytes(testDataOutput, 0xFFFFFF00);
    Assert.assertArrayEquals(new byte[]{-128, -2, -1, -1, 15}, testOutput.toByteArray());
    testOutput.reset();
}