Java tutorial
//package com.java2s; public class Main { private static byte[] bwkey(byte[] key) { int len = key.length; int i = 16 - len; byte[] result = new byte[16]; System.arraycopy(key, 0, result, 0, len); for (int j = len; j < i; j++) { result[j] = 0x00; } return result; } }