Examples of SAMTextHeaderCodec


Examples of htsjdk.samtools.SAMTextHeaderCodec

            final SAMFileHeader header = in.getFileHeader();
            if (header.getTextHeader() != null) {
                writer.write(header.getTextHeader());
            } else {
                // Headers that are too large are not retained as text, so need to regenerate text
                new SAMTextHeaderCodec().encode(writer, header, true);
            }

            for (final SAMRecord rec : in) {
                if (printStream.checkError()) {
                    return 1;
View Full Code Here

Examples of net.sf.samtools.SAMTextHeaderCodec

  }

  private static byte[] toByteArray(SAMFileHeader samFileHeader) {
    ExposedByteArrayOutputStream headerBodyOS = new ExposedByteArrayOutputStream();
    OutputStreamWriter w = new OutputStreamWriter(headerBodyOS);
    new SAMTextHeaderCodec().encode(w, samFileHeader);
    try {
      w.close();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

Examples of net.sf.samtools.SAMTextHeaderCodec

    byte[] bytes = new byte[size];
    dis.readFully(bytes);

    BufferedLineReader r = new BufferedLineReader(new ByteArrayInputStream(
        bytes));
    return new SAMTextHeaderCodec().decode(r, id);
  }
View Full Code Here

Examples of net.sf.samtools.SAMTextHeaderCodec

  }

  private String toString(SAMFileHeader h) {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    OutputStreamWriter w = new OutputStreamWriter(baos);
    new SAMTextHeaderCodec().encode(w, h);
    try {
      w.close();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
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.