From 7af6c4ca50322258bbd23214920c4c9122482966 Mon Sep 17 00:00:00 2001 From: CGantert345 <57003061+CGantert345@users.noreply.github.com> Date: Tue, 25 Jan 2022 13:33:37 +0100 Subject: test for the new dynamic header version 2 --- src/main/java/org/uic/barcode/asn1/uper/AsnUtils.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/main/java/org/uic/barcode/asn1') diff --git a/src/main/java/org/uic/barcode/asn1/uper/AsnUtils.java b/src/main/java/org/uic/barcode/asn1/uper/AsnUtils.java index dbb95c9..414f181 100644 --- a/src/main/java/org/uic/barcode/asn1/uper/AsnUtils.java +++ b/src/main/java/org/uic/barcode/asn1/uper/AsnUtils.java @@ -1,5 +1,7 @@ package org.uic.barcode.asn1.uper; +import java.math.BigInteger; + public class AsnUtils { @@ -55,5 +57,19 @@ public class AsnUtils { boolean result = (bytes[index / 8] & mask[index % 8]) != 0; return result; } + + public static byte[] shiftBytesToLeft(byte[] bytes, int shift) { + + // create from array + BigInteger bigInt = new BigInteger(bytes); + + // shift + BigInteger shiftInt = bigInt.shiftLeft(shift); + + // back to array + return shiftInt.toByteArray(); + + } + } -- cgit v1.2.3