@Override public void setOutputStream(final OutputStream os) { bamCodec.setOutputStream(os); }
@Override public void setOutputStream(final OutputStream os) { bamCodec.setOutputStream(os); }
private void prepareToWriteAlignments() { if (bamRecordCodec == null) { bamRecordCodec = new BAMRecordCodec(getFileHeader()); bamRecordCodec.setOutputStream(outputBinaryCodec.getOutputStream(), getFilename()); } }
@Override public void write(DataOutput out) throws IOException { // In theory, it shouldn't matter whether we give a header to // BAMRecordCodec or not, since the representation of an alignment in BAM // doesn't depend on the header data at all. Only its interpretation // does, and a simple read/write codec shouldn't really have anything to // say about that. (But in practice, it already does matter for decode(), // which is why LazyBAMRecordFactory exists.) final BAMRecordCodec codec = new BAMRecordCodec(record.getHeader()); codec.setOutputStream(new DataOutputWrapper(out)); codec.encode(record); } @Override public void readFields(DataInput in) throws IOException {
private void prepareToWriteAlignments() { if (bamRecordCodec == null) { bamRecordCodec = new BAMRecordCodec(getFileHeader()); bamRecordCodec.setOutputStream(outputBinaryCodec.getOutputStream(), getFilename()); } }
private void init( OutputStream output, SAMFileHeader header, boolean writeHeader) throws IOException { origOutput = output; compressedOut = new BlockCompressedOutputStream(origOutput, null); binaryCodec = new BinaryCodec(compressedOut); recordCodec = new BAMRecordCodec(header); recordCodec.setOutputStream(compressedOut); if (writeHeader) this.writeHeader(header); }
private void init( OutputStream output, SAMFileHeader header, boolean writeHeader, boolean useIntelDeflater) throws IOException { origOutput = output; if (useIntelDeflater) { compressedOut = new BlockCompressedOutputStream(origOutput, null, BlockCompressedStreamConstants.DEFAULT_COMPRESSION_LEVEL, IntelGKLAccessor.newDeflaterFactory()); } else { compressedOut = new BlockCompressedOutputStream(origOutput, null); } binaryCodec = new BinaryCodec(compressedOut); recordCodec = new BAMRecordCodec(header); recordCodec.setOutputStream(compressedOut); if (writeHeader) this.writeHeader(header); }
@Override public void write(DataOutput out) throws IOException { // In theory, it shouldn't matter whether we give a header to // BAMRecordCodec or not, since the representation of an alignment in BAM // doesn't depend on the header data at all. Only its interpretation // does, and a simple read/write codec shouldn't really have anything to // say about that. (But in practice, it already does matter for decode(), // which is why LazyBAMRecordFactory exists.) final BAMRecordCodec codec = new BAMRecordCodec(record.getHeader()); codec.setOutputStream(new DataOutputWrapper(out)); codec.encode(record); } @Override public void readFields(DataInput in) throws IOException {
private void prepareToWriteAlignments() { if (bamRecordCodec == null) { bamRecordCodec = new BAMRecordCodec(getFileHeader()); bamRecordCodec.setOutputStream(outputBinaryCodec.getOutputStream(), getFilename()); } }
@Override public void write(DataOutput out) throws IOException { // In theory, it shouldn't matter whether we give a header to // BAMRecordCodec or not, since the representation of an alignment in BAM // doesn't depend on the header data at all. Only its interpretation // does, and a simple read/write codec shouldn't really have anything to // say about that. (But in practice, it already does matter for decode(), // which is why LazyBAMRecordFactory exists.) final BAMRecordCodec codec = new BAMRecordCodec(record.getHeader()); codec.setOutputStream(new DataOutputWrapper(out)); codec.encode(record); } @Override public void readFields(DataInput in) throws IOException {
private void init( OutputStream output, SAMFileHeader header, boolean writeHeader, boolean useIntelDeflater) throws IOException { origOutput = output; if (useIntelDeflater) { compressedOut = new BlockCompressedOutputStream(origOutput, null, BlockCompressedStreamConstants.DEFAULT_COMPRESSION_LEVEL, IntelGKLAccessor.newDeflaterFactory()); } else { compressedOut = new BlockCompressedOutputStream(origOutput, null); } binaryCodec = new BinaryCodec(compressedOut); recordCodec = new BAMRecordCodec(header); recordCodec.setOutputStream(compressedOut); if (writeHeader) this.writeHeader(header); }
codec.setOutputStream(os); for (CramCompressionRecord record : records) { SAMRecord samRecord = f.create(record);