/[Apache-SVN]/lucene/nutch/trunk/src/java/org/apache/nutch/protocol/Content.java
ViewVC logotype

Diff of /lucene/nutch/trunk/src/java/org/apache/nutch/protocol/Content.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- lucene/nutch/trunk/src/java/org/apache/nutch/protocol/Content.java	2005/12/17 09:37:22	357333
+++ lucene/nutch/trunk/src/java/org/apache/nutch/protocol/Content.java	2005/12/17 10:06:31	357334
@@ -77,11 +77,8 @@ public final class Content extends Compr
 
     contentType = UTF8.readString(in);            // read contentType
 
-    int propertyCount = in.readInt();             // read metadata
     metadata = new ContentProperties();
-    for (int i = 0; i < propertyCount; i++) {
-      metadata.put(UTF8.readString(in), UTF8.readString(in));
-    }
+    metadata.readFields(in);                    // read meta data
   }
 
   protected final void writeCompressed(DataOutput out) throws IOException {
@@ -95,13 +92,7 @@ public final class Content extends Compr
 
     UTF8.writeString(out, contentType);           // write contentType
     
-    out.writeInt(metadata.size());                // write metadata
-    Iterator i = metadata.entrySet().iterator();
-    while (i.hasNext()) {
-      Map.Entry e = (Map.Entry)i.next();
-      UTF8.writeString(out, (String)e.getKey());
-      UTF8.writeString(out, (String)e.getValue());
-    }
+    metadata.write(out);                           // write metadata
   }
 
   public static Content read(DataInput in) throws IOException {

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26