Package org.apache.axiom.attachments.utils

Examples of org.apache.axiom.attachments.utils.BAAInputStream


        /* (non-Javadoc)
         * @see javax.activation.DataSource#getInputStream()
         */
        public InputStream getInputStream() throws IOException {
            InputStream is  = new BAAInputStream(data, length);
            String cte = null;
            try {
                cte = getContentTransferEncoding();
                if(cte != null){
                    if(log.isDebugEnabled()){
View Full Code Here


            log.debug("Enter ParserInputStreamDataSource.copy()");
        }
        try {
            BAAOutputStream baaos = new BAAOutputStream();
            BufferUtils.inputStream2OutputStream(data.readParserInputStream(), baaos);
            BAAInputStream baais = new BAAInputStream(baaos.buffers(),
                        baaos.length());
           
            if (log.isDebugEnabled()) {
                log.debug("Exit ParserInputStreamDataSource.copy()");
            }
View Full Code Here

                            log.debug("The inputStream does not supports mark().  Copying Stream");
                        }
                        // make a non-contiguous resettable input stream
                        BAAOutputStream baaos = new BAAOutputStream();
                        BufferUtils.inputStream2OutputStream(inputStream, baaos);
                        BAAInputStream baais = new BAAInputStream(baaos.buffers(),
                                    baaos.length());
                        payload = baais;
                        payload.mark(Integer.MAX_VALUE);
                    } catch (Throwable t) {
                        if(log.isDebugEnabled()){
View Full Code Here

                    if (total < thresholdSize) {
                        return new PartOnMemoryEnhanced(headers, baaos.buffers(), baaos.length());
                    } else {
                        // A BAAInputStream is an input stream over a list of non-contiguous 4K buffers.
                        BAAInputStream baais =
                            new BAAInputStream(baaos.buffers(), baaos.length());

                        part = new PartOnFile(manager, headers,
                                              baais,
                                              in,
                                              attachmentDir);
View Full Code Here

                }
            } finally {
                in = null; // GC the incoming stream
            }
           
            localStream = new BAAInputStream(baaos.buffers(), baaos.length());
            if (log.isDebugEnabled()) {
                log.debug("The local stream built from the detached " +
                                "stream has a length of:" + baaos.length());
            }
            count = count + baaos.length();
View Full Code Here

               
                if (total < threshholdSize) {
                    return new PartOnMemoryEnhanced(headers, baaos.buffers(), baaos.length());
                } else {
                    // A BAAInputStream is an input stream over a list of non-contiguous 4K buffers.
                    BAAInputStream baais =
                        new BAAInputStream(baaos.buffers(), baaos.length());
                   
                    return new PartOnFile(manager, headers,
                                          baais,
                                          in,
                                          attachmentDir);
View Full Code Here

        // There is no file name
        return null;
    }

    public InputStream getInputStream() throws IOException, MessagingException {
        return new BAAInputStream(data, length);
    }
View Full Code Here

        /* (non-Javadoc)
         * @see javax.activation.DataSource#getInputStream()
         */
        public InputStream getInputStream() throws IOException {
            InputStream is  = new BAAInputStream(data, length);
            String cte = null;
            try {
                cte = getContentTransferEncoding();
                if(cte != null){
                    if(log.isDebugEnabled()){
View Full Code Here

            inputBAIS.reset();
            BAAOutputStream baaos = new BAAOutputStream();
            BufferUtils.inputStream2OutputStream(inputBAIS, baaos);
            assertTrue("1: " + baaos.length() + " " + INPUT_SIZE, baaos.length() == INPUT_SIZE);

            BAAInputStream baais = new BAAInputStream(baaos.buffers(), baaos.length());
            baaos = new BAAOutputStream();
            BufferUtils.inputStream2OutputStream(baais, baaos);
            baais = new BAAInputStream(baaos.buffers(), baaos.length());
            baaos = new BAAOutputStream();
            for (int j= 1; j < 1000; j++) {
                baaos.write(baais.read());
            }
            BufferUtils.inputStream2OutputStream(baais, baaos);
            assertTrue("" + baaos.length() + " " + INPUT_SIZE, baaos.length() == INPUT_SIZE);
        }
        //System.out.println("Enhanced time = " + (System.currentTimeMillis()-time));
View Full Code Here

                    if (count < thresholdSize) {
                        partContent = new PartContentOnMemory(baaos.buffers(), baaos.length());
                    } else {
                        // A BAAInputStream is an input stream over a list of non-contiguous 4K buffers.
                        BAAInputStream baais =
                            new BAAInputStream(baaos.buffers(), baaos.length());

                        partContent = new PartContentOnFile(manager,
                                              baais,
                                              in,
                                              attachmentDir);
View Full Code Here

TOP

Related Classes of org.apache.axiom.attachments.utils.BAAInputStream

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.