Examples of EncodingBase64InputStream


Examples of org.fcrepo.server.journal.helpers.EncodingBase64InputStream

        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);
        }
    }
View Full Code Here

Examples of org.fcrepo.server.journal.helpers.EncodingBase64InputStream

     */
    private String readClearFileCreateEncodedString(File source)
            throws IOException {
        // use a small buffer size, not a multiple, so we will do multiple
        // reads.
        EncodingBase64InputStream encoder =
                new EncodingBase64InputStream(new FileInputStream(source), 61);
        StringBuffer encoded = new StringBuffer();
        String chunk;
        while (null != (chunk = encoder.read(35))) {
            encoded.append(chunk);
        }
        encoder.close();

        String encodedString = encoded.toString();
        return encodedString;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.