add ByteOrderMark

This commit is contained in:
Looly
2023-03-29 13:42:26 +08:00
parent 41cb8a6db7
commit 27e1f5f61e
6 changed files with 225 additions and 19 deletions

View File

@@ -719,4 +719,19 @@ public class ArrayUtilTest {
b = ArrayUtil.startWith((int[])null, null);
Assert.assertTrue(b);
}
@Test
public void equalsTest() {
final boolean b = ObjUtil.equals(new int[]{1, 2, 3}, new int[]{1, 2, 3});
Assert.assertTrue(b);
}
@Test
public void copyOfRangeTest() {
String a = "aIDAT";
final byte[] bytes1 = Arrays.copyOfRange(a.getBytes(CharsetUtil.UTF_8), 1, 1 + 4);
Assert.assertEquals(new String(bytes1),
new String(a.getBytes(CharsetUtil.UTF_8), 1, 4));
}
}