@Test public void testSerialization() throws Exception { final int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; VSizeColumnarInts ints = VSizeColumnarInts.fromArray(array); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ints.writeTo(Channels.newChannel(baos), null); final byte[] bytes = baos.toByteArray(); Assert.assertEquals(ints.getSerializedSize(), bytes.length); VSizeColumnarInts deserialized = VSizeColumnarInts.readFromByteBuffer(ByteBuffer.wrap(bytes)); Assert.assertEquals(1, deserialized.getNumBytes()); Assert.assertEquals(array.length, deserialized.size()); for (int i = 0; i < array.length; i++) { Assert.assertEquals(array[i], deserialized.get(i)); } } }