Examples of RandomAccessFileInputStream


Examples of org.apache.pdfbox.io.RandomAccessFileInputStream

            {
                InputStream input = null;
                try
                {
                    input = new BufferedInputStream(
                        new RandomAccessFileInputStream( file, position, length ), BUFFER_SIZE );
                  IOUtils.closeQuietly(unFilteredStream);
                    unFilteredStream = new RandomAccessFileOutputStream( file );
                    filter.decode( input, unFilteredStream, this, filterIndex );
                    done = true;
                }
                catch( IOException io )
                {
                    length--;
                    exception = io;
                }
                finally
                {
                  IOUtils.closeQuietly(input);
                }
            }
            if( !done )
            {
                //if no good stream was found then lets try again but with the
                //length of data that was actually read and not length
                //defined in the dictionary
                length = writtenLength;
                for( int tryCount=0; !done && tryCount<5; tryCount++ )
                {
                    InputStream input = null;
                    try
                    {
                        input = new BufferedInputStream(
                            new RandomAccessFileInputStream( file, position, length ), BUFFER_SIZE );
                      IOUtils.closeQuietly(unFilteredStream);
                        unFilteredStream = new RandomAccessFileOutputStream( file );
                        filter.decode( input, unFilteredStream, this, filterIndex );
                        done = true;
                    }
View Full Code Here

Examples of org.apache.pdfbox.io.RandomAccessFileInputStream

    {
        FilterManager manager = getFilterManager();
        Filter filter = manager.getFilter( filterName );

        InputStream input = new BufferedInputStream(
            new RandomAccessFileInputStream( file, filteredStream.getPosition(),
                                                   filteredStream.getLength() ), BUFFER_SIZE );
        IOUtils.closeQuietly(filteredStream);
        filteredStream = new RandomAccessFileOutputStream( file );
        filter.encode( input, filteredStream, this, filterIndex );
        IOUtils.closeQuietly(input);
View Full Code Here

Examples of org.apache.pdfbox.io.RandomAccessFileInputStream

            doEncode();
        }
        long position = filteredStream.getPosition();
        long length = filteredStream.getLength();

        RandomAccessFileInputStream input =
            new RandomAccessFileInputStream( file, position, length );
        return new BufferedInputStream( input, BUFFER_SIZE );
    }
View Full Code Here

Examples of org.apache.pdfbox.io.RandomAccessFileInputStream

        //created yet, so we should return null.
        if( unFilteredStream != null )
        {
            long position = unFilteredStream.getPosition();
            long length = unFilteredStream.getLength();
            RandomAccessFileInputStream input =
                new RandomAccessFileInputStream( file, position, length );
            retval = new BufferedInputStream( input, BUFFER_SIZE );
        }
        else
        {
            // We should check if the COSStream contains data, maybe it
View Full Code Here

Examples of org.apache.pdfbox.io.RandomAccessFileInputStream

            for( int tryCount=0; !done && tryCount<5; tryCount++ )
            {
                try
                {
                    input = new BufferedInputStream(
                        new RandomAccessFileInputStream( file, position, length ), BUFFER_SIZE );
                    unFilteredStream = new RandomAccessFileOutputStream( file );
                    filter.decode( input, unFilteredStream, this, filterIndex );
                    done = true;
                }
                catch( IOException io )
                {
                    length--;
                    exception = io;
                }
            }
            if( !done )
            {
                //if no good stream was found then lets try again but with the
                //length of data that was actually read and not length
                //defined in the dictionary
                length = writtenLength;
                for( int tryCount=0; !done && tryCount<5; tryCount++ )
                {
                    try
                    {
                        input = new BufferedInputStream(
                            new RandomAccessFileInputStream( file, position, length ), BUFFER_SIZE );
                        unFilteredStream = new RandomAccessFileOutputStream( file );
                        filter.decode( input, unFilteredStream, this, filterIndex );
                        done = true;
                    }
                    catch( IOException io )
View Full Code Here

Examples of org.apache.pdfbox.io.RandomAccessFileInputStream

        FilterManager manager = getFilterManager();
        Filter filter = manager.getFilter( filterName );
        InputStream input;

        input = new BufferedInputStream(
            new RandomAccessFileInputStream( file, filteredStream.getPosition(),
                                                   filteredStream.getLength() ), BUFFER_SIZE );
        filteredStream = new RandomAccessFileOutputStream( file );
        filter.encode( input, filteredStream, this, filterIndex );
    }
View Full Code Here

Examples of org.apache.pdfbox.io.RandomAccessFileInputStream

            doEncode();
        }
        long position = filteredStream.getPosition();
        long length = filteredStream.getLength();

        RandomAccessFileInputStream input =
            new RandomAccessFileInputStream( file, position, length );
        return new BufferedInputStream( input, BUFFER_SIZE );
    }
View Full Code Here

Examples of org.apache.pdfbox.io.RandomAccessFileInputStream

        //created yet, so we should return null.
        if( unFilteredStream != null )
        {
            long position = unFilteredStream.getPosition();
            long length = unFilteredStream.getLength();
            RandomAccessFileInputStream input =
                new RandomAccessFileInputStream( file, position, length );
            retval = new BufferedInputStream( input, BUFFER_SIZE );
        }
        else
        {
            // We should check if the COSStream contains data, maybe it
View Full Code Here

Examples of org.apache.pdfbox.io.RandomAccessFileInputStream

            for( int tryCount=0; !done && tryCount<5; tryCount++ )
            {
                try
                {
                    input = new BufferedInputStream(
                        new RandomAccessFileInputStream( file, position, length ), BUFFER_SIZE );
                    unFilteredStream = new RandomAccessFileOutputStream( file );
                    filter.decode( input, unFilteredStream, this, filterIndex );
                    done = true;
                }
                catch( IOException io )
                {
                    length--;
                    exception = io;
                }
            }
            if( !done )
            {
                //if no good stream was found then lets try again but with the
                //length of data that was actually read and not length
                //defined in the dictionary
                length = writtenLength;
                for( int tryCount=0; !done && tryCount<5; tryCount++ )
                {
                    try
                    {
                        input = new BufferedInputStream(
                            new RandomAccessFileInputStream( file, position, length ), BUFFER_SIZE );
                        unFilteredStream = new RandomAccessFileOutputStream( file );
                        filter.decode( input, unFilteredStream, this, filterIndex );
                        done = true;
                    }
                    catch( IOException io )
View Full Code Here

Examples of org.apache.pdfbox.io.RandomAccessFileInputStream

        FilterManager manager = getFilterManager();
        Filter filter = manager.getFilter( filterName );
        InputStream input;

        input = new BufferedInputStream(
            new RandomAccessFileInputStream( file, filteredStream.getPosition(),
                                                   filteredStream.getLength() ), BUFFER_SIZE );
        filteredStream = new RandomAccessFileOutputStream( file );
        filter.encode( input, filteredStream, this, filterIndex );
    }
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.