jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r365947 - in /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state: mem/InMemPersistenceManager.java util/Serializer.java
Date Wed, 04 Jan 2006 17:11:58 GMT
Author: stefan
Date: Wed Jan  4 09:11:43 2006
New Revision: 365947

URL: http://svn.apache.org/viewcvs?rev=365947&view=rev
Log:
use DataInputStream.readFully for reading known fixed-length data formats

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/util/Serializer.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java?rev=365947&r1=365946&r2=365947&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java
Wed Jan  4 09:11:43 2006
@@ -199,7 +199,7 @@
                 }
                 int length = in.readInt();  // data length
                 byte[] data = new byte[length];
-                in.read(data);  // data
+                in.readFully(data);  // data
                 // store in map
                 stateStore.put(id, data);
             }
@@ -219,7 +219,7 @@
                 NodeReferencesId id = (NodeReferencesId) NodeReferencesId.valueOf(s);
                 int length = in.readInt();  // data length
                 byte[] data = new byte[length];
-                in.read(data);  // data
+                in.readFully(data);  // data
                 // store in map
                 refsStore.put(id, data);
             }

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/util/Serializer.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/util/Serializer.java?rev=365947&r1=365946&r2=365947&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/util/Serializer.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/state/util/Serializer.java
Wed Jan  4 09:11:43 2006
@@ -122,7 +122,7 @@
         state.setNodeTypeName(QName.valueOf(s));
         // parentUUID (may be null)
         byte[] uuidBytes = new byte[UUID.UUID_BYTE_LENGTH];
-        in.read(uuidBytes);
+        in.readFully(uuidBytes);
         UUID uuid = new UUID(uuidBytes);
         if (!uuid.equals(NULL_UUID_PLACEHOLDER)) {
             state.setParentUUID(uuid.toString());
@@ -152,7 +152,7 @@
         for (int i = 0; i < count; i++) {
             QName name = QName.valueOf(in.readUTF());    // name
             // uuid
-            in.read(uuidBytes);
+            in.readFully(uuidBytes);
             state.addChildNodeEntry(name, new UUID(uuidBytes).toString());
         }
     }
@@ -307,7 +307,7 @@
                 //s = in.readUTF();   // value
                 int len = in.readInt(); // lenght of byte[]
                 byte[] bytes = new byte[len];
-                in.read(bytes); // byte[]
+                in.readFully(bytes); // byte[]
                 s = new String(bytes, ENCODING);
                 val = InternalValue.valueOf(s, type);
             }



Mime
View raw message