public byte[] toByteArray()
{
byte[] buf = IOUtils.safelyAllocate(getSizeInBytes(), MAX_RECORD_LENGTH);
int offset = 0;
_lvlf.setCbGrpprlChpx( (short) _grpprlChpx.length );
_lvlf.setCbGrpprlPapx( (short) _grpprlPapx.length );
_lvlf.serialize( buf, offset );
offset += LVLF.getSize();
System.arraycopy( _grpprlPapx, 0, buf, offset, _grpprlPapx.length );
offset += _grpprlPapx.length;
System.arraycopy( _grpprlChpx, 0, buf, offset, _grpprlChpx.length );
offset += _grpprlChpx.length;
_xst.serialize( buf, offset );
offset += _xst.getSize();
return buf;
}