public static Pair<IV, int> extractIVFromContent(BufferReference content) { if (content.Length < 1 || content.Length < content[0] + 1) throw new InternalError("Failed to extract IV from encrypted block."); var ivBytes = content[0]; var iv = new byte[content[0]]; content.copy(1, iv, 0, ivBytes); return Pair.make(new IV(iv), 1 + ivBytes); }