You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/11/24 13:16:19 UTC

[GitHub] [lucene-solr] iverase commented on a change in pull request #2094: LUCENE-9047: Move the Directory APIs to be little endian

iverase commented on a change in pull request #2094:
URL: https://github.com/apache/lucene-solr/pull/2094#discussion_r529536245



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/CodecUtil.java
##########
@@ -570,6 +571,23 @@ static void writeCRC(IndexOutput output) throws IOException {
     if ((value & 0xFFFFFFFF00000000L) != 0) {
       throw new IllegalStateException("Illegal CRC-32 checksum: " + value + " (resource=" + output + ")");
     }
-    output.writeLong(value);
+    writeChecksum(output, value);
   }
+  
+  private static int readVersion(DataInput in) throws IOException {
+    return EndiannessReverserUtil.readInt(in);
+  }
+
+  private static void writeVersion(DataOutput out, int version) throws IOException {
+    EndiannessReverserUtil.writeInt(out, version);
+  }
+
+  private static long readChecksum(DataInput in) throws IOException {
+    return EndiannessReverserUtil.readLong(in);
+  }
+
+  private static void writeChecksum(DataOutput out, long checksum) throws IOException {
+    EndiannessReverserUtil.writeLong(out, checksum);
+  }

Review comment:
       yes, that make sense.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org