--- MarkersDumpingStrategy_1.java	Thu Aug  6 11:38:48 2009
+++ MarkersSnapshotDumpingStrategy_1.java	Fri Aug  7 15:29:33 2009
@@ -17,44 +17,43 @@
 import org.eclipse.core.tools.metadata.*;
 
 /**
- * A strategy for reading .markers files version 1. Layout:
+ * A strategy for reading .markers.snap files version 1. Layout:
  * <pre>
- * SAVE_FILE -> VERSION_ID RESOURCE+
- * VERSION_ID -> 
- * RESOURCE -> RESOURCE_PATH MARKERS_SIZE MARKER*
+
+ * SNAP_FILE -> [VERSION_ID RESOURCE]*
+ * VERSION_ID -> int (used for backwards compatibiliy)
+ * RESOURCE -> RESOURCE_PATH MARKER_SIZE MARKER+
  * RESOURCE_PATH -> String
- * MARKERS_SIZE -> int
+ * MARKER_SIZE -> int
  * MARKER -> MARKER_ID TYPE ATTRIBUTES_SIZE ATTRIBUTE*
  * MARKER_ID -> long
  * TYPE -> INDEX | QNAME
- * INDEX -> int int
- * QNAME -> int String
- * ATTRIBUTES_SIZE -> int
+ * INDEX -> byte int
+ * QNAME -> byte String
+ * ATTRIBUTES_SIZE -> short
  * ATTRIBUTE -> ATTRIBUTE_KEY ATTRIBUTE_VALUE
  * ATTRIBUTE_KEY -> String
- * ATTRIBUTE_VALUE -> INTEGER_VALUE | BOOLEAN_VALUE | STRING_VALUE | NULL_VALUE
- * INTEGER_VALUE -> int int
- * BOOLEAN_VALUE -> int boolean
- * STRING_VALUE -> int String
- * NULL_VALUE -> int
+ * ATTRIBUTE_VALUE -> BOOLEAN_VALUE | INTEGER_VALUE | STRING_VALUE | NULL_VALUE
+ * BOOLEAN_VALUE -> byte boolean
+ * INTEGER_VALUE -> byte int
+ * STRING_VALUE -> byte String
+ * NULL_VALUE -> byte
  * </pre>
  */
-public class MarkersDumpingStrategy_1 implements IStringDumpingStrategy {
+class MarkersSnapshotDumpingStrategy_1 implements IStringDumpingStrategy {
 
 	/**
 	 * @see org.eclipse.core.tools.resources.metadata.IStringDumpingStrategy#dumpStringContents(DataInputStream)
 	 */
-	public String dumpStringContents(DataInputStream dataInput) throws IOException, DumpException {
+	public String dumpStringContents(DataInputStream input) throws IOException, DumpException {
 		StringBuffer contents = new StringBuffer();
+		DataInputStream dataInput = new DataInputStream(input);
 		List markerTypes = new ArrayList();
-		while (dataInput.available() > 0) {
-			String resourceName = dataInput.readUTF();
-			contents.append("Resource: "); //$NON-NLS-1$
-			contents.append(resourceName);
-			contents.append('\n');
-			dumpMarkers(dataInput, contents, markerTypes);
-			contents.append('\n');
-		}
+		String resourceName = dataInput.readUTF();
+		contents.append("Resource: "); //$NON-NLS-1$
+		contents.append(resourceName);
+		contents.append('\n');
+		dumpMarkers(dataInput, contents, markerTypes);
 		return contents.toString();
 	}
 
@@ -70,31 +69,30 @@
 			contents.append('\n');
 			dumpMarkerType(input, contents, markerTypes);
 			dumpAttributes(input, contents);
-			contents.append('\n');
 		}
 	}
 
 	private void dumpAttributes(DataInputStream input, StringBuffer contents) throws IOException, DumpException {
-		int attributesSize = input.readInt();
+		int attributesSize = input.readShort();
 		contents.append("Attributes ["); //$NON-NLS-1$
 		contents.append(attributesSize);
 		contents.append("]:"); //$NON-NLS-1$
 		contents.append('\n');
 		for (int j = 0; j < attributesSize; j++) {
 			contents.append(input.readUTF());
-			int type = input.readInt();
+			byte type = input.readByte();
 			Object value = null;
 			switch (type) {
-				case MarkersDumper.ATTRIBUTE_INTEGER :
+				case MarkersSnapshotDumper.ATTRIBUTE_INTEGER :
 					value = new Integer(input.readInt());
 					break;
-				case MarkersDumper.ATTRIBUTE_BOOLEAN :
+				case MarkersSnapshotDumper.ATTRIBUTE_BOOLEAN :
 					value = input.readBoolean() ? Boolean.TRUE : Boolean.FALSE;
 					break;
-				case MarkersDumper.ATTRIBUTE_STRING :
+				case MarkersSnapshotDumper.ATTRIBUTE_STRING :
 					value = "\"" + input.readUTF() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
 					break;
-				case MarkersDumper.ATTRIBUTE_NULL :
+				case MarkersSnapshotDumper.ATTRIBUTE_NULL :
 					break;
 				default :
 					throw new PartialDumpException("Invalid marker attribute type found: " + type, contents); //$NON-NLS-1$
@@ -107,13 +105,13 @@
 
 	private void dumpMarkerType(DataInputStream input, StringBuffer contents, List markerTypes) throws IOException, DumpException {
 		String markerType;
-		int constant = input.readInt();
+		byte constant = input.readByte();
 		switch (constant) {
-			case MarkersDumper.QNAME :
+			case MarkersSnapshotDumper.QNAME :
 				markerType = input.readUTF();
 				markerTypes.add(markerType);
 				break;
-			case MarkersDumper.INDEX :
+			case MarkersSnapshotDumper.INDEX :
 				markerType = (String) markerTypes.get(input.readInt());
 				break;
 			default :
