@Test public void testUnpackBytes() throws Exception { assertThat(new String(AES.unPackBytes(AES.pack(unpaddedtext)), "UTF-8"), is(unpaddedtext)); }
public static byte[] unPackBytes(byte[] bytes) { int length = ((bytes[0] & 0xff) << 24) | ((bytes[1] & 0xff) << 16) | ((bytes[2] & 0xff) << 8) | (bytes[3] & 0xff); return Arrays.copyOfRange(bytes, 4, length + 4); }
AES { public static byte[] unPackBytes(byte[] bytes) { int length = ((bytes[0] & 0xff) << 24) | ((bytes[1] & 0xff) << 16) | ((bytes[2] & 0xff) << 8) | (bytes[3] & 0xff); return Arrays.copyOfRange(bytes, 4, length + 4); } }
AES { public static byte[] unPackBytes(byte[] bytes) { int length = ((bytes[0] & 0xff) << 24) | ((bytes[1] & 0xff) << 16) | ((bytes[2] & 0xff) << 8) | (bytes[3] & 0xff); return Arrays.copyOfRange(bytes, 4, length + 4); }  }
AES { public static byte[] unPackBytes(byte[] bytes) { int length = ((bytes[0] & 0xff) << 24) | ((bytes[1] & 0xff) << 16) | ((bytes[2] & 0xff) << 8) | (bytes[3] & 0xff); return Arrays.copyOfRange(bytes, 4, length + 4); }  static byte[] encrypt(byte[] bytes, byte[] encryptionKey); static byte[] decrypt(byte[] cipherText, byte[] encryptionKey); static byte[] pack(byte[] bytes); static byte[] pack(String string); static byte[] unPackBytes(byte[] bytes); static String unPackString(byte[] bytes); static String encode(byte[] bytesToEncode); static byte[] decode(String stringToDecode); }
AES { public static byte[] unPackBytes(byte[] bytes) { int length = ((bytes[0] & 0xff) << 24) | ((bytes[1] & 0xff) << 16) | ((bytes[2] & 0xff) << 8) | (bytes[3] & 0xff); return Arrays.copyOfRange(bytes, 4, length + 4); }  static byte[] encrypt(byte[] bytes, byte[] encryptionKey); static byte[] decrypt(byte[] cipherText, byte[] encryptionKey); static byte[] pack(byte[] bytes); static byte[] pack(String string); static byte[] unPackBytes(byte[] bytes); static String unPackString(byte[] bytes); static String encode(byte[] bytesToEncode); static byte[] decode(String stringToDecode);  }