Skip to content

Commit

Permalink
set default byte order to little endian
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-northlander committed Oct 30, 2024
1 parent ecb02df commit 8b540b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/worksap/nlp/sudachi/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ public ByteBuffer asByteBuffer() throws IOException {
if (Objects.equals(url.getProtocol(), "file")) {
return MMap.map(url.getPath());
}
return StringUtil.readAllBytes(url, ByteOrder.LITTLE_ENDIAN);
return StringUtil.readAllBytes(url);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/worksap/nlp/sudachi/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static String readFully(InputStream stream) throws IOException {
}

public static ByteBuffer readAllBytes(URL url) throws IOException {
return readAllBytes(url, ByteOrder.BIG_ENDIAN);
return readAllBytes(url, ByteOrder.LITTLE_ENDIAN);
}

public static ByteBuffer readAllBytes(URL url, ByteOrder order) throws IOException {
Expand All @@ -67,7 +67,7 @@ public static ByteBuffer readAllBytes(URL url, ByteOrder order) throws IOExcepti
}

public static ByteBuffer readAllBytes(InputStream inputStream) throws IOException {
return readAllBytes(inputStream, ByteOrder.BIG_ENDIAN);
return readAllBytes(inputStream, ByteOrder.LITTLE_ENDIAN);
}

public static ByteBuffer readAllBytes(InputStream inputStream, ByteOrder order) throws IOException {
Expand Down

0 comments on commit 8b540b1

Please sign in to comment.