mirror of
https://gitee.com/BDWare/common
synced 2025-01-10 01:44:16 +00:00
add write boolean to util
This commit is contained in:
parent
488fbb4a63
commit
821add2a62
@ -80,6 +80,14 @@ public class ByteUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean readBoolean(ByteArrayInputStream bi) {
|
||||||
|
return bi.read() == 0x01;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void writeBoolean(ByteArrayOutputStream bo, boolean b) {
|
||||||
|
bo.write(b ? 0x01 : 0x00);
|
||||||
|
}
|
||||||
|
|
||||||
public static byte[] readBytes(ByteArrayInputStream bi, int len) {
|
public static byte[] readBytes(ByteArrayInputStream bi, int len) {
|
||||||
byte[] ret = new byte[len];
|
byte[] ret = new byte[len];
|
||||||
bi.read(ret, 0, len);
|
bi.read(ret, 0, len);
|
||||||
|
Loading…
Reference in New Issue
Block a user