diff --git a/src/main/base/org/bdware/sc/conn/ByteUtil.java b/src/main/base/org/bdware/sc/conn/ByteUtil.java index a0625ec..fdb33d0 100644 --- a/src/main/base/org/bdware/sc/conn/ByteUtil.java +++ b/src/main/base/org/bdware/sc/conn/ByteUtil.java @@ -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);