From 99f0c110643d2257eda612c8a8f8303c26907db5 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Sat, 8 Aug 2020 11:50:59 -0700 Subject: [PATCH] Created static factory method for constructing a BitInput from a byte array --- core/src/com/riiablo/io/nio/BitInput.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/com/riiablo/io/nio/BitInput.java b/core/src/com/riiablo/io/nio/BitInput.java index e6b94682..6bc3bf3a 100644 --- a/core/src/com/riiablo/io/nio/BitInput.java +++ b/core/src/com/riiablo/io/nio/BitInput.java @@ -3,6 +3,10 @@ package com.riiablo.io.nio; import org.apache.commons.lang3.StringUtils; public class BitInput { + public static BitInput wrap(byte[] bytes) { + return ByteInput.wrap(bytes).unalign(); + } + private static final int MAX_ULONG_BITS = Long.SIZE - 1; private static final int MAX_UINT_BITS = Integer.SIZE - 1; private static final int MAX_USHORT_BITS = Short.SIZE - 1;