code: public static byte[] readBytes(final BitInput bitInput, final int lengthSize, final boolean byteUnsigned,
                                     final int byteSize)
              throws IOException {
          if (bitInput == null) {
              throw new NullPointerException("bitInput is null");
          }
          requireValidSizeInt(true, lengthSize);
          requireValidSizeByte(byteUnsigned, byteSize);
          final int length = bitInput.readInt(true, lengthSize);
          final byte[] byteArray = new byte[length];
          for (int i = 0; i < byteArray.length; i++) {
              byteArray[i] = bitInput.readByte(byteUnsigned, byteSize);
          }
          return byteArray;
      }
docs: -----------------------------------------------------------------------------------------------------------------