private static byte[] combine(ArrayDeque<byte[]> deque) {
    int totalSize = 0;
    for (byte[] buf : deque) {
      totalSize += buf.length;
    }
    byte[] result = new byte[totalSize];
    int curSize = 0;
    for (byte[] buf : deque) {
      System.arraycopy(buf, 0, result, curSize, buf.length);
      curSize += buf.length;
    }
    return result;
  }
Writes the keyset managed by {@code handle} to {@code outputStream} with format {@code
outFormat}. Maybe encrypt it with {@code masterKeyUri} and {@code credentialPath}.
tools/tinkey/src/main/java/com/google/crypto/tink/tinkey/TinkeyUtil.java