Package java.io

Examples of java.io.SequenceInputStream


        }
        String contentType = (String) message.get(Message.CONTENT_TYPE);
        if (contentType != null && contentType.toLowerCase().startsWith(MULTIPART_CONTENT)) {
            try {
                Session session = Session.getDefaultInstance(new Properties());
                is = new SequenceInputStream(new ByteArrayInputStream(new byte[] { 13, 10 }), is);
                MimeMessage mime = new MimeMessage(session, is);
                mime.setHeader(Message.CONTENT_TYPE, contentType);
                read(message, mime);
            } catch (IOException e) {
                throw new Fault(e);
View Full Code Here


  public SoapMessage read(InputStream is, String contentType)
      throws Exception {
    if (contentType != null && startsWithCaseInsensitive(contentType, SoapMarshaler.MULTIPART_CONTENT)) {
      Session session = Session.getDefaultInstance(new Properties());
            is = new SequenceInputStream(new ByteArrayInputStream(new byte[] { 13, 10 }), is);
      MimeMessage mime = new MimeMessage(session, is);
      mime.setHeader(SoapMarshaler.MIME_CONTENT_TYPE, contentType);
      return read(mime);
    } else {
      return read(is);
View Full Code Here

        InputStream stream = null;
        for (String dependency : JavascriptResource.DEPENDENCIES) {
            if (stream == null) {
                stream = this.getClass().getResourceAsStream(dependency);
            } else {
                stream = new SequenceInputStream(stream, this.getClass().getResourceAsStream(dependency));
            }
        }
        final String generatedJs = JavascriptGenerator.getJavascript().toString() + "\n}";
        return new SequenceInputStream(stream, new ByteArrayInputStream(generatedJs.getBytes()));
    }
View Full Code Here

            byte[] data = new byte[pos];
            System.arraycopy(buffer, 0, data, 0, pos);
            return BLOBInMemory.getInstance(data);
        } else {
            // a few bytes are already read, need to re-build the input stream
            in = new SequenceInputStream(new ByteArrayInputStream(buffer, 0, pos), in);
            if (store != null) {
                return BLOBInDataStore.getInstance(store, in);
            } else {
                return BLOBInTempFile.getInstance(in, temporary);
            }
View Full Code Here

        // if headers do not contains minimum REQUIRED headers fields throw Exception
        if (!headers.isValid()) {
            throw new MessagingException("Some REQURED header field is missing. Invalid Message");
        }
        ByteArrayInputStream headersIn = new ByteArrayInputStream(headers.toByteArray());
        sendMail(new MailImpl(getId(), sender, recipients, new SequenceInputStream(headersIn, msg)));
    }
View Full Code Here

            conn.close();

            InputStream in = new ByteArrayInputStream(headers);
            try {
                if (sr != null) {
                    in = new SequenceInputStream(in, sr.get(key));
                }
            } catch (Exception e) {
                //ignore this... either sr is null, or the file does not exist
                // or something else
            }
View Full Code Here

        // if headers do not contains minimum REQUIRED headers fields throw Exception
        if (!headers.isValid()) {
            throw new MessagingException("Some REQURED header field is missing. Invalid Message");
        }
        ByteArrayInputStream headersIn = new ByteArrayInputStream(headers.toByteArray());
        sendMail(new MailImpl(getId(), sender, recipients, new SequenceInputStream(headersIn, msg)));
    }
View Full Code Here

        byte[] xmlContent = xml.getBytes( encoding );
        InputStream in = new ByteArrayInputStream( xmlContent );

        if ( bom != null )
        {
            in = new SequenceInputStream( new ByteArrayInputStream( bom ), in );
        }

        XmlStreamReader reader = new XmlStreamReader( in );
        assertEquals( encoding, reader.getEncoding() );
        String result = IOUtil.toString( reader );
View Full Code Here

            //Now read any input and process

            BufferedReader input = new BufferedReader(
                    new InputStreamReader(
                            new SequenceInputStream(is, es)));

            String line;
            while ((line = input.readLine()) != null) {
                process(line);
            }
View Full Code Here

        InputStream input = getBase().newInputStream();
        for (int i = 1;; i++) {
            FilePath f = getBase(i);
            if (f.exists()) {
                InputStream i2 = f.newInputStream();
                input = new SequenceInputStream(input, i2);
            } else {
                break;
            }
        }
        return input;
View Full Code Here

TOP

Related Classes of java.io.SequenceInputStream

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.