Record r = null;
/* This must surely be an earlier hack?? Delete when confident
short adjustedSize = size;
if ( size < 0 )
{
adjustedSize = 0;
}
else if ( offset + size > data.length )
{
adjustedSize = (short) ( data.length - offset );
if ( adjustedSize > 4 )
{
adjustedSize -= 4;
}
}
*/
switch ( in.getSid() )
{
case CommonObjectDataSubRecord.sid:
r = new CommonObjectDataSubRecord( in );
break;
case GroupMarkerSubRecord.sid:
r = new GroupMarkerSubRecord( in );
break;
case EndSubRecord.sid:
r = new EndSubRecord( in );
break;
case NoteStructureSubRecord.sid:
r = new NoteStructureSubRecord( in );
break;
default:
r = new UnknownRecord( in );
}
return r;