public void read(DataInputStream in) throws IOException {
  if (in.readInt() != FILE_VERSION) {
  }
  String[] names=new String[in.readShort()];
  for (int i=0; i < names.length; i++) {
    names[i]=in.readUTF();
  }
  int num=in.readShort();
  for (int i=0; i < num; i++) {
    short nameId=in.readShort();
    int type=in.readByte();
    String name=in.readUTF();
    defEntity(names[nameId],type | GENERAL,name);
  }
  num=in.readShort();
  for (int i=0; i < num; i++) {
    short nameId=in.readShort();
    int type=in.readByte();
    byte flags=in.readByte();
    ContentModel m=readContentModel(in,names);
    String[] exclusions=readNameArray(in,names);
    String[] inclusions=readNameArray(in,names);
    AttributeList atts=readAttributeList(in,names);
    defElement(names[nameId],type,((flags & 0x01) != 0),((flags & 0x02) != 0),m,exclusions,inclusions,atts);
  }
}

public void read ( DataInputStream in ) throws IOException { if ( in . readInt ( ) != FILE_VERSION ) { } String [ ] names = new String [ in . readShort ( ) ] ; for ( int i = 0 ; i < names . length ; i ++ ) { names [ i ] = in . readUTF ( ) ; } int num = in . readShort ( ) ; for ( int i = 0 ; i < num ; i ++ ) { short nameId = in . readShort ( ) ; int type = in . readByte ( ) ; String name = in . readUTF ( ) ; defEntity ( names [ nameId ] , type | GENERAL , name ) ; } num = in . readShort ( ) ; for ( int i = 0 ; i < num ; i ++ ) { short nameId = in . readShort ( ) ; int type = in . readByte ( ) ; byte flags = in . readByte ( ) ; ContentModel m = readContentModel ( in , names ) ; String [ ] exclusions = readNameArray ( in , names ) ; String [ ] inclusions = readNameArray ( in , names ) ; AttributeList atts = readAttributeList ( in , names ) ; defElement ( names [ nameId ] , type , ( ( flags & 0x01 ) != 0 ) , ( ( flags & 0x02 ) != 0 ) , m , exclusions , inclusions , atts ) ; } }
recreates a dtd from an archived format .
