Package slash.common.io

Examples of slash.common.io.NotClosingUnderlyingInputStream.mark()


        try {
            ZipEntry entry;
            while ((entry = zip.getNextEntry()) != null) {
                NotClosingUnderlyingInputStream buffer = new NotClosingUnderlyingInputStream(new BufferedInputStream(zip));
                int size = (int) entry.getSize() + 1;
                buffer.mark(size);
                List<NavigationFormat> formats = getReadFormatsPreferredByExtension(Files.getExtension(entry.getName()));
                parserContext.parse(buffer, startDate, formats);
                zip.closeEntry();
            }
        } catch (IOException e) {
View Full Code Here


    public ParserResult read(File source, List<NavigationFormat> formats) throws IOException {
        log.info("Reading '" + source.getAbsolutePath() + "' by " + formats.size() + " formats");
        FileInputStream fis = new FileInputStream(source);
        NotClosingUnderlyingInputStream buffer = new NotClosingUnderlyingInputStream(new BufferedInputStream(fis));
        buffer.mark((int) source.length() + 1);
        try {
            return read(buffer, (int) source.length(), getStartDate(source), formats);
        } finally {
            buffer.closeUnderlyingInputStream();
        }
View Full Code Here

    private ParserResult read(InputStream source, int readBufferSize, CompactCalendar startDate,
                              List<NavigationFormat> formats) throws IOException {
        log.fine("Reading '" + source + "' with a buffer of " + readBufferSize + " bytes by " + formats.size() + " formats");
        NotClosingUnderlyingInputStream buffer = new NotClosingUnderlyingInputStream(new BufferedInputStream(source));
        buffer.mark(readBufferSize + 1);
        try {
            ParserContext<BaseRoute> context = new InternalParserContext<BaseRoute>();
            internalRead(buffer, startDate, formats, context);
            return createResult(context);
        } finally {
View Full Code Here

            urlString = urlString.replace("CWD", new File(".").getCanonicalPath()).replace(separatorChar, '/');
            URL url = new URL(urlString);
            int readBufferSize = getSize(url);
            log.info("Reading '" + url + "' with a buffer of " + readBufferSize + " bytes");
            NotClosingUnderlyingInputStream buffer = new NotClosingUnderlyingInputStream(new BufferedInputStream(url.openStream()));
            buffer.mark(readBufferSize + 1);
            try {
                internalRead(buffer, getStartDate(url), getReadFormats(), this);
            } finally {
                buffer.closeUnderlyingInputStream();
            }
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.