try {
putStartTag(writer, QNAME_TAG_ARGUMENT);
putAttribute(writer, QNAME_ATTR_NAME, key);
putAttribute(writer, QNAME_ATTR_TYPE, ARGUMENT_TYPE_STREAM);
EncodingBase64InputStream encoder =
new EncodingBase64InputStream(new BufferedInputStream(new FileInputStream(file)));
String encodedChunk;
while (null != (encodedChunk = encoder.read(1000))) {
putCharacters(writer, encodedChunk);
}
encoder.close();
putEndTag(writer, QNAME_TAG_ARGUMENT);
} catch (IOException e) {
throw new JournalException("IO Exception on temp file", e);
}
}