Package java.io

Examples of java.io.BufferedInputStream.reset()


            }

            InputStream entryStream = new BufferedInputStream(zip, 4096);
            entryStream.mark(4096);
            IWORKDocumentType type = IWORKDocumentType.detectType(entryStream);
            entryStream.reset();
           
            if(type != null) {
               XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
               ContentHandler contentHandler;
              
View Full Code Here


                        return b;
                    }
                }
            }
            try {
                is.reset();
            } catch (IOException e) {
                is.close();
                is = new BufferedInputStream(new URL(bundleLocation).openStream());
            }
            LOGGER.debug("Installing bundle " + bundleLocation);
View Full Code Here

        try {
            final InputStream result = new GZIPInputStream(bis);
            return result;
        } catch (final IOException e) {
            e.printStackTrace();
            bis.reset();
            return bis;
        }
    }

}
View Full Code Here

                os.write(lineFeed);
                os.flush();
                readAck(is, false);

                // now send the stream
                buffer.reset();
                while ((read = buffer.read(reply)) != -1) {
                    os.write(reply, 0, read);
                }
                writeAck(os);
                readAck(is, false);
View Full Code Here

        final PrintWriter out = new PrintWriter(new OutputStreamWriter(outStream, "UTF-8"));
        final BufferedInputStream in = new BufferedInputStream(inStream);

        in.mark(MAX_HEADER_LENGTH); // assume the header is never larger than 10000 bytes.
        copyHeader(in, out);
        in.reset(); // reposition the stream at the beginning

        try {
            UpdaterHandler updaterHandler = new UpdaterHandler(settings, out, resolvedRevisions,
                    status, revision, pubdate, ns, replaceInclude, confsToExclude, inStreamCtx);
            XMLHelper.parse(in, null, updaterHandler, updaterHandler);
View Full Code Here

                                      decl.indexOf( '"' , off + key.length()) );
            }
        }
        logger.info("URLFetcher: found URL with encoding -> " + enc );
        //Reset the bytes read
        is.reset();
        Reader rdr = new InputStreamReader( is,
                                            enc );
        return rdr;
    }
View Full Code Here

                                      decl.indexOf( '"' , off + key.length()) );
            }
        }
        logger.info("URLFetcher: found URL with encoding -> " + enc );
        //Reset the bytes read
        is.reset();
        Reader rdr = new InputStreamReader( is,
                                            enc );
        return rdr;
    }
View Full Code Here

        if (head != 0x30)
        {
            throw new IOException("stream does not represent a PKCS12 key store");
        }

        bufIn.reset();

        ASN1InputStream bIn = new ASN1InputStream(bufIn);
        ASN1Sequence    obj = (ASN1Sequence)bIn.readObject();
        Pfx             bag = new Pfx(obj);
        ContentInfo     info = bag.getAuthSafe();
View Full Code Here

        if (head != 0x30)
        {
            throw new IOException("stream does not represent a PKCS12 key store");
        }

        bufIn.reset();

        ASN1InputStream bIn = new ASN1InputStream(bufIn);
        ASN1Sequence    obj = (ASN1Sequence)bIn.readObject();
        Pfx             bag = new Pfx(obj);
        ContentInfo     info = bag.getAuthSafe();
View Full Code Here

        int bytesRead = bin.read(peek);
        if (bytesRead != peek.length) {
            throw new IOException("Read only " + bytesRead
                    + "bytes, expecting " + peek.length);
        }
        bin.reset();

        if ((new String(peek)).startsWith("<?xm")) {
            // file is an XML file.
            PlotBoxMLParser parser = _newParser();
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.