修复读取长整型数组时的字节顺序错误
This commit is contained in:
parent
e0520f713f
commit
35a38e1ffc
@ -33,6 +33,6 @@ fn read_array() {
|
|||||||
fn read_long_array() {
|
fn read_long_array() {
|
||||||
let data = vec![0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08];
|
let data = vec![0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08];
|
||||||
let mut reader = NbtReader::new(&data);
|
let mut reader = NbtReader::new(&data);
|
||||||
assert_eq!(reader.read_long_array(1), &[i64::from_be_bytes([0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08])]);
|
assert_eq!(reader.read_long_array(1), &[i64::from_ne_bytes([0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08])]);
|
||||||
assert_eq!(reader.cursor, 8);
|
assert_eq!(reader.cursor, 8);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user