Package java.io

Examples of java.io.SequenceInputStream


                public InputStream nextElement() {
                    return streams[index++];
               
               
            };
            return new SequenceInputStream(list);
        } else {
            return is;
        }
                
    }
View Full Code Here


            encodeParam.setCompressedText(ztextArray);
        }

        // Parse prior IDAT chunks
        InputStream seqStream =
            new SequenceInputStream(streamVec.elements());
        InputStream infStream =
            new InflaterInputStream(seqStream, new Inflater());
        dataStream = new DataInputStream(infStream);
       
        // Create an empty WritableRaster
View Full Code Here

     */
    private boolean readTrailer() throws IOException {
        InputStream in = this.in;
        int n = inf.getRemaining();
        if (n > 0) {
            in = new SequenceInputStream(
                        new ByteArrayInputStream(buf, len - n, n),
                        new FilterInputStream(in) {
                            public void close() throws IOException {}
                        });
        }
View Full Code Here

        Inflater inf = null;
        try {
            stream.seek(imageStartPosition);

            Enumeration<InputStream> e = new PNGImageDataEnumeration(stream);
            InputStream is = new SequenceInputStream(e);

           /* InflaterInputStream uses an Inflater instance which consumes
            * native (non-GC visible) resources. This is normally implicitly
            * freed when the stream is closed. However since the
            * InflaterInputStream wraps a client-supplied input stream,
View Full Code Here

        Inflater inf = null;
        try {
            stream.seek(imageStartPosition);

            Enumeration e = new PNGImageDataEnumeration(stream);
            InputStream is = new SequenceInputStream(e);

            // InflaterInputStream uses an Inflater instance which consumes
            // native (non-GC visible) resources. This is normally implicitly
            // freed when the stream is closed. However since the
            // InflaterInputStream wraps a client-supplied input stream,
View Full Code Here

            in = source.getInputStream();
            headers = new MailHeaders(in);

            ByteArrayInputStream headersIn
                    = new ByteArrayInputStream(headers.toByteArray());
            in = new SequenceInputStream(headersIn, in);

            message = new MimeMessage(session, in);
        } catch (IOException ioe) {
            ioe.printStackTrace();
            throw new MessagingException("Unable to parse stream: " + ioe.getMessage(), ioe);
View Full Code Here

  public SoapMessage read(InputStream is, String contentType)
      throws Exception {
    if (contentType != null && contentType.toLowerCase().startsWith(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

            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

        v.add(ds.getInputStream());
        v.add(new ByteArrayInputStream("</a>".getBytes("ascii")));
        XMLInputFactory factory = XMLInputFactory.newInstance();
        factory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
        XMLStreamReader reader = factory.createXMLStreamReader(
                new SequenceInputStream(v.elements()), "ascii");
        OMElement element = new StAXOMBuilder(reader).getDocumentElement();
        Reader in = ElementHelper.getTextAsStream(element, false);
        compareStreams(new InputStreamReader(ds.getInputStream(), "ascii"), in);
    }
View Full Code Here

                public InputStream nextElement() {
                    return streams[index++];
               
               
            };
            return new SequenceInputStream(list);
        } else {
            return is;
        }
                
    }
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.