Package net.sf.block

Examples of net.sf.block.Block


    SAMRecord samRecord = null;
    CramHeader cramHeader = createCramHeader(reader.getFileHeader());
    ByteArrayOutputStream hBaos= new ByteArrayOutputStream() ;
    Container hC = new Container() ;
    Block hBlock = new Block() ;
    hBlock.contentId=0;
    hBlock.contentType=0;
    hBlock.method = CompressionMethod.GZIP.byteValue() ;
    hC.blocks = new Block[]{hBlock} ;
    hC.containers= new Container[0] ;
View Full Code Here


    crBlock.setRecordCount(records.size());

    ByteArrayOutputStream bhBAOS = new ByteArrayOutputStream();
    CramRecordBlockWriter w = new CramRecordBlockWriter(bhBAOS);
    w.write(crBlock);
    Block block = new Block();
    block.contentType = ContentType.HEADER.getContentType();
    block.contentId = 0;
    block.data = bhBAOS.toByteArray();
    block.method = CompressionMethod.GZIP.byteValue();
    blocks.add(block);

    CramRecordCodec codec = buildCodec(cramHeader, crBlock, provider);

    List<Short> tagCodes = new ArrayList<Short>();
    tagCodes.add(SAMTagUtil.getSingleton().makeBinaryTag("OQ"));

    HashMap<Integer, MyDataOutputStream> osMap = new HashMap<Integer, MyDataOutputStream>();
    osMap.put((int)ContentType.QUAL.getContentType(), new MyDataOutputStream());
    for (short code : tagCodes)
      osMap.put((int) code, new MyDataOutputStream());

    codec.osMap = osMap;

    int counter = 0;

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    BitOutputStream bos = new DefaultBitOutputStream(baos);

    Iterator<CramRecord> iterator = records.iterator();
    long time1 = System.nanoTime();
    while (iterator.hasNext()) {

      for (int i = 0; i < recordsPerSlice; i++) {
        if (!iterator.hasNext())
          break;
        CramRecord record = iterator.next();
        codec.write(bos, record);
        counter++;
      }

      bos.close();
      block = new Block();
      block.contentType = ContentType.CORE.getContentType();
      block.contentId = 0;
      block.data = baos.toByteArray();
      block.method = CompressionMethod.GZIP.byteValue();
      blocks.add(block);
      baos.reset();
      for (Integer key : osMap.keySet()) {
        block = new Block();
        if (key > ContentType.TAG.getContentType()) {
          block.contentType = ContentType.TAG.getContentType();
          block.contentId = key.shortValue();
        } else {
          block.contentType = key.byteValue();
View Full Code Here

    List<Short> tagCodes = new ArrayList<Short>();
    tagCodes.add(SAMTagUtil.getSingleton().makeBinaryTag("OQ"));

    long counter = crBlock.getRecordCount();
    while (b < c.blocks.length) {
      Block block = c.blocks[b++];
      if (block.contentType != ContentType.CORE.getContentType())
        throw new RuntimeException("Wrong content type: " + block.contentType);
      if (block.contentId != 0)
        throw new RuntimeException("Wrong content id: " + block.contentId);
      BitInputStream bis = new DefaultBitInputStream(new ByteArrayInputStream(block.data));
View Full Code Here

  public void switchTo(int sliceIndex) {
    currentSliceIndex = sliceIndex;
    currentSliceBlockIndex = sliceBlockIndicies[currentSliceIndex];

    Block sliceBlock = blocks[currentSliceBlockIndex];
    currentSlice = new Slice(sliceBlock);
    sliceBlocks.clear();
    for (int i = 1; i < currentSlice.blockContentIds.length; i++) {
      Block block = blocks[currentSliceBlockIndex + i];
      sliceBlocks.put(block.contentId, block);
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.block.Block

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.