Package htsjdk.samtools.util

Examples of htsjdk.samtools.util.BlockCompressedOutputStream


                                                 final boolean allowCompressed) {
        try {
            // we cannot merge compressed outputs, so don't compress if allowCompressed is false,
            // which is the case when we have a temporary output file for later merging
            if ( allowCompressed && stub.isCompressed() )
                stream = new BlockCompressedOutputStream(file);
            else
                stream = new PrintStream(new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE));
        }
        catch(IOException ex) {
            throw new UserException.CouldNotCreateOutputFile(file, "Unable to open target output stream", ex);
View Full Code Here


        }
        this.size = size;

        final OutputStream outputStream;
        if (BclReader.isGzipped(cycleFile)) outputStream = new GZIPOutputStream(new FileOutputStream(cycleFile));
        else if (BclReader.isBlockGzipped(cycleFile)) outputStream = new BlockCompressedOutputStream(cycleFile);
        else outputStream = new FileOutputStream(cycleFile);

        final WritableByteChannel channel = Channels.newChannel(outputStream);
        final ByteBuffer buffer = ByteBuffer.allocate(this.bufferSize());
        buffer.order(ByteOrder.LITTLE_ENDIAN);
View Full Code Here

                        }

                        // If we found the end of the header then write the remainder of this block out as a
                        // new gzip block and then break out of the while loop
                        if (firstNonHeaderByteIndex >= 0) {
                            final BlockCompressedOutputStream blockOut = new BlockCompressedOutputStream(out, null);
                            blockOut.write(blockContents, firstNonHeaderByteIndex, blockContents.length - firstNonHeaderByteIndex);
                            blockOut.flush();
                            // Don't close blockOut because closing underlying stream would break everything
                            break;
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of htsjdk.samtools.util.BlockCompressedOutputStream

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.