private static ContentImpl parseContent(OleBlobImpl blob) throws IOException {
  ByteBuffer bb=PageChannel.wrap(blob.getBytes());
  if ((bb.remaining() < 2) || (bb.getShort() != PACKAGE_SIGNATURE)) {
    return new UnknownContentImpl(blob);
  }
  int headerSize=bb.getShort();
  bb.getInt();
  int prettyNameLen=bb.getShort();
  int classNameLen=bb.getShort();
  int prettyNameOff=bb.getShort();
  int classNameOff=bb.getShort();
  bb.getInt();
  String prettyName=readStr(bb,prettyNameOff,prettyNameLen);
  String className=readStr(bb,classNameOff,classNameLen);
  bb.position(headerSize);
  int oleVer=bb.getInt();
  bb.getInt();
  if (oleVer != OLE_VERSION) {
    return new UnknownContentImpl(blob);
  }
  int typeNameLen=bb.getInt();
  String typeName=readStr(bb,bb.position(),typeNameLen);
  bb.getLong();
  int dataBlockLen=bb.getInt();
  int dataBlockPos=bb.position();
  if (SIMPLE_PACKAGE_TYPE.equalsIgnoreCase(typeName)) {
    return createSimplePackageContent(blob,prettyName,className,typeName,bb,dataBlockLen);
  }
  if ((COMPOUND_FACTORY != null) && (bb.remaining() >= COMPOUND_STORAGE_SIGNATURE.length) && ByteUtil.matchesRange(bb,bb.position(),COMPOUND_STORAGE_SIGNATURE)) {
    return COMPOUND_FACTORY.createCompoundPackageContent(blob,prettyName,className,typeName,bb,dataBlockLen);
  }
  return new OtherContentImpl(blob,prettyName,className,typeName,dataBlockPos,dataBlockLen);
}

private static ContentImpl parseContent ( OleBlobImpl blob ) throws IOException { ByteBuffer bb = PageChannel . wrap ( blob . getBytes ( ) ) ; if ( ( bb . remaining ( ) < 2 ) || ( bb . getShort ( ) != PACKAGE_SIGNATURE ) ) { return new UnknownContentImpl ( blob ) ; } int headerSize = bb . getShort ( ) ; bb . getInt ( ) ; int prettyNameLen = bb . getShort ( ) ; int classNameLen = bb . getShort ( ) ; int prettyNameOff = bb . getShort ( ) ; int classNameOff = bb . getShort ( ) ; bb . getInt ( ) ; String prettyName = readStr ( bb , prettyNameOff , prettyNameLen ) ; String className = readStr ( bb , classNameOff , classNameLen ) ; bb . position ( headerSize ) ; int oleVer = bb . getInt ( ) ; bb . getInt ( ) ; if ( oleVer != OLE_VERSION ) { return new UnknownContentImpl ( blob ) ; } int typeNameLen = bb . getInt ( ) ; String typeName = readStr ( bb , bb . position ( ) , typeNameLen ) ; bb . getLong ( ) ; int dataBlockLen = bb . getInt ( ) ; int dataBlockPos = bb . position ( ) ; if ( SIMPLE_PACKAGE_TYPE . equalsIgnoreCase ( typeName ) ) { return createSimplePackageContent ( blob , prettyName , className , typeName , bb , dataBlockLen ) ; } if ( ( COMPOUND_FACTORY != null ) && ( bb . remaining ( ) >= COMPOUND_STORAGE_SIGNATURE . length ) && ByteUtil . matchesRange ( bb , bb . position ( ) , COMPOUND_STORAGE_SIGNATURE ) ) { return COMPOUND_FACTORY . createCompoundPackageContent ( blob , prettyName , className , typeName , bb , dataBlockLen ) ; } return new OtherContentImpl ( blob , prettyName , className , typeName , dataBlockPos , dataBlockLen ) ; }
creates the appropriate contentimpl for the given blob .
