Package net.sf.cram.io

Examples of net.sf.cram.io.ExposedByteArrayOutputStream.toByteArray()


      headerOS.write(headerBodyOS.getBuffer(), 0, headerBodyOS.size());
    } catch (IOException e) {
      throw new RuntimeException(e);
    }

    return headerOS.toByteArray();
  }

  private static long writeContainer(SAMFileHeader samFileHeader,
      OutputStream os) throws IOException {
    Block block = new Block();
View Full Code Here


        : BlockContentType.RESERVED;

    bos.close();
    slice.coreBlock = new Block();
    slice.coreBlock.method = BlockCompressionMethod.RAW.ordinal();
    slice.coreBlock.setRawContent(bitBAOS.toByteArray());
    slice.coreBlock.contentType = BlockContentType.CORE;

    slice.external = new HashMap<Integer, Block>();
    for (Integer i : map.keySet()) {
      ExposedByteArrayOutputStream os = map.get(i);
View Full Code Here

      Block externalBlock = new Block();
      externalBlock.contentType = BlockContentType.EXTERNAL;
      externalBlock.method = BlockCompressionMethod.GZIP.ordinal();
      externalBlock.contentId = i;

      externalBlock.setRawContent(os.toByteArray());
      slice.external.put(i, externalBlock);
    }

    return slice;
  }
View Full Code Here

    }

    ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream(
        BYTES);
    ReadWrite.writeCramHeader(cramHeader, baos);
    byte[] b = baos.toByteArray();
    ByteArrayInputStream bais = new ByteArrayInputStream(b);
    CramHeader cramHeader2 = ReadWrite.readCramHeader(bais);
    assertEquals(toString(cramHeader.samFileHeader),
        toString(cramHeader2.samFileHeader));
View Full Code Here

      container2.slices[i].refMD5 = container.slices[i].refMD5;
    }

    ReadWrite.writeContainer(container2, baos);

    bais = new ByteArrayInputStream(baos.toByteArray());

    cramHeader2 = ReadWrite.readCramHeader(bais);
    assertNotNull(cramHeader);
    assertNotNull(cramHeader.samFileHeader);
    assertEquals(2, cramHeader.majorVersion);
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.