Skip to content

Commit 8b540b1

Browse files
set default byte order to little endian
1 parent ecb02df commit 8b540b1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/com/worksap/nlp/sudachi/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ public ByteBuffer asByteBuffer() throws IOException {
960960
if (Objects.equals(url.getProtocol(), "file")) {
961961
return MMap.map(url.getPath());
962962
}
963-
return StringUtil.readAllBytes(url, ByteOrder.LITTLE_ENDIAN);
963+
return StringUtil.readAllBytes(url);
964964
}
965965

966966
@Override

src/main/java/com/worksap/nlp/sudachi/StringUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static String readFully(InputStream stream) throws IOException {
5757
}
5858

5959
public static ByteBuffer readAllBytes(URL url) throws IOException {
60-
return readAllBytes(url, ByteOrder.BIG_ENDIAN);
60+
return readAllBytes(url, ByteOrder.LITTLE_ENDIAN);
6161
}
6262

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

6969
public static ByteBuffer readAllBytes(InputStream inputStream) throws IOException {
70-
return readAllBytes(inputStream, ByteOrder.BIG_ENDIAN);
70+
return readAllBytes(inputStream, ByteOrder.LITTLE_ENDIAN);
7171
}
7272

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

0 commit comments

Comments
 (0)