Package org.apache.james.protocols.imap.utils

Examples of org.apache.james.protocols.imap.utils.FastByteArrayOutputStream


     */
    public String consumeLiteral(final Charset charset) throws DecodingException {
        if (charset == null) {
            return consumeLiteral(US_ASCII);
        } else {
            FastByteArrayOutputStream out = new FastByteArrayOutputStream();
            InputStream in = null;
            try {
              in = consumeLiteral(false);
              byte[] buf = new byte[ 0xFFFF ];
               
              for (int len; (len = in.read(buf)) != -1; )
                    out.write( buf, 0, len );
               
                final byte[] bytes = out.toByteArray();
                final ByteBuffer buffer = ByteBuffer.wrap(bytes);
                return decode(charset, buffer);
               
            } catch (IOException e) {
                throw new DecodingException(HumanReadableText.BAD_IO_ENCODING, "Bad character encoding", e);
View Full Code Here


    public ImapResponseComposerImpl(final ImapResponseWriter writer, int bufferSize) {
        skipNextSpace = false;
        usAscii = Charset.forName("US-ASCII");
        this.writer = writer;
        this.buffer = new FastByteArrayOutputStream(bufferSize);
    }
View Full Code Here

TOP

Related Classes of org.apache.james.protocols.imap.utils.FastByteArrayOutputStream

Copyright © 2018 www.massapicom. 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.