mirror of
https://gitee.com/BDWare/common
synced 2026-02-15 00:59:29 +00:00
Compare commits
1 Commits
lyh_local_
...
raft
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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) {
|
||||
byte[] ret = new byte[len];
|
||||
bi.read(ret, 0, len);
|
||||
|
||||
Reference in New Issue
Block a user