BaseLocationBox bloc = new BaseLocationBox();
bloc.setBaseLocation("baseloc");
bloc.setPurchaseLocation("purchloc");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bloc.getBox(Channels.newChannel(baos));
byte[] boxAsBytes = baos.toByteArray();
ByteBuffer bb = (ByteBuffer.wrap(boxAsBytes));
long lengthWritten = IsoTypeReader.readUInt32(bb);
Assert.assertEquals("bloc", IsoTypeReader.read4cc(bb));
BaseLocationBox bloc2 = new BaseLocationBox();
bloc2.parse(new ByteBufferByteChannel(bb), null, lengthWritten - 8, null);
Assert.assertEquals(lengthWritten, bloc2.getSize());
Assert.assertEquals(lengthWritten, bloc.getSize());
Assert.assertEquals(bloc.getBaseLocation(), bloc2.getBaseLocation());
Assert.assertEquals(bloc.getPurchaseLocation(), bloc2.getPurchaseLocation());
Assert.assertTrue(bloc.equals(bloc2));