Code example for ByteArrayDataOutput

Methods: toByteArray

0
    } 
 
    public void testLong(long l) throws IOException {
        final VarULongSerializer serializer = new VarULongSerializer();
        final ByteArrayDataOutput out = ByteStreams.newDataOutput();
        serializer.write(l, out);
        assertEquals(l, serializer.read(ByteStreams.newDataInput(out.toByteArray())).longValue());
    } 
 
    public void testInt(int i) throws IOException {
        final VarULongSerializer serializer = new VarULongSerializer();
        final ByteArrayDataOutput out = ByteStreams.newDataOutput();
        out.writeInt(i);
        assertEquals(i, serializer.read(ByteStreams.newDataInput(out.toByteArray())).longValue());
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java