public void write(DataOutputStream dos) throws IOException {
  dos.writeInt((size() + 1) * 2);
  dos.writeInt(LPC_PROPERY_MANAGEMENT_POLICY.length());
  dos.writeChars(LPC_PROPERY_MANAGEMENT_POLICY);
  if (reuseProperties == Boolean.TRUE) {
    dos.writeInt(LPC_REUSE_PROPERTIES.length());
    dos.writeChars(LPC_REUSE_PROPERTIES);
  }
 else {
    dos.writeInt(LPC_CLEAR_PROPERTIES.length());
    dos.writeChars(LPC_CLEAR_PROPERTIES);
  }
  for (Enumeration e=propertyNames(); e.hasMoreElements(); ) {
    String key=(String)e.nextElement();
    String value=getProperty(key);
    dos.writeInt(key.length());
    dos.writeChars(key);
    dos.writeInt(value.length());
    dos.writeChars(value);
  }
}

public void write ( DataOutputStream dos ) throws IOException { dos . writeInt ( ( size ( ) + 1 ) * 2 ) ; dos . writeInt ( LPC_PROPERY_MANAGEMENT_POLICY . length ( ) ) ; dos . writeChars ( LPC_PROPERY_MANAGEMENT_POLICY ) ; if ( reuseProperties == Boolean . TRUE ) { dos . writeInt ( LPC_REUSE_PROPERTIES . length ( ) ) ; dos . writeChars ( LPC_REUSE_PROPERTIES ) ; } else { dos . writeInt ( LPC_CLEAR_PROPERTIES . length ( ) ) ; dos . writeChars ( LPC_CLEAR_PROPERTIES ) ; } for ( Enumeration e = propertyNames ( ) ; e . hasMoreElements ( ) ; ) { String key = ( String ) e . nextElement ( ) ; String value = getProperty ( key ) ; dos . writeInt ( key . length ( ) ) ; dos . writeChars ( key ) ; dos . writeInt ( value . length ( ) ) ; dos . writeChars ( value ) ; } }
write the properties as several strings . there is a string count ( key count + value count ) , and then for each key and value string , a character count , and the characters .
