Package net.sf.cram.io

Examples of net.sf.cram.io.DefaultBitInputStream


    bos.close();
    long time2=System.nanoTime() ;

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

    long time3=System.nanoTime() ;
    for (int i = 0; i < size; i++) {
      for (int b : cal.values()) {
        int v = c.read(bis);
View Full Code Here


    }

    bos.close();

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

    for (int b : values) {
      int v = c.read(bis);
      if (v != b)
        fail("Mismatch: " + v + " vs " + b);
View Full Code Here

    bos.close();

    codec = e.buildCodec(null, null);
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    DefaultBitInputStream bis = new DefaultBitInputStream(bais);

    for (int i = 0; i < names.length; i++) {
      int v = codec.read(bis);
      if (v != names[i].length())
        fail("Mismatch: " + v + " vs " + names[i].length());
View Full Code Here

      bos.flush();

      byte[] buf = baos.toByteArray();

      ByteArrayInputStream bais = new ByteArrayInputStream(buf);
      BitInputStream bis = new DefaultBitInputStream(bais);
      long number = codec.read(bis);
      System.out.printf("%d: %d\t%s\t%d\t%s\n", i, number, IOUtils
          .toBitString(buf).subSequence(0, len), len, IOUtils
          .toBitString(buf));
    }
View Full Code Here

    assertThat(len, is(bitsLen));

    byte[] buf = baos.toByteArray();

    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
    BitInputStream bis = new DefaultBitInputStream(bais);
    int number = codec.read(bis);
    assertThat(number, is(value));

    String bitsString = IOUtils.toBitString(buf);
    assertThat(bitsString, equalTo("10000000"));
View Full Code Here

    assertThat(len, is(bitsLen));

    byte[] buf = baos.toByteArray();

    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
    BitInputStream bis = new DefaultBitInputStream(bais);
    int number = codec.read(bis);
    assertThat(number, is(value));

    String bitsString = IOUtils.toBitString(buf);
    assertThat(bitsString, equalTo("10100000"));
View Full Code Here

    assertThat(len, is(bitsLen));

    byte[] buf = baos.toByteArray();

    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
    BitInputStream bis = new DefaultBitInputStream(bais);
    int number = codec.read(bis);
    assertThat(number, is(value));

    String bitsString = IOUtils.toBitString(buf);
    assertThat(bitsString, equalTo("00000100"));
View Full Code Here

    assertThat(len, is(bitsLen));

    byte[] buf = baos.toByteArray();

    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
    BitInputStream bis = new DefaultBitInputStream(bais);
    int number = codec.read(bis);
    assertThat(number, is(value));

    String bitsString = IOUtils.toBitString(buf);
    assertThat(
View Full Code Here

    byte oneByteValue = 20;

    byte[] buf = new byte[maxNumbers];
    Arrays.fill(buf, oneByteValue);
    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
    BitInputStream bis = new DefaultBitInputStream(bais);
    for (int i = 0; i < maxNumbers; i++)
      codec.read(bis);
  }
View Full Code Here

    bos.flush();
    baos.close();

    byte[] buf = baos.toByteArray();
    ByteArrayInputStream bais = new ByteArrayInputStream(buf);
    BitInputStream bis = new DefaultBitInputStream(bais);
    for (int i = 0; i < maxValue; i++)
      assertThat(codec.read(bis), is(i));
  }
View Full Code Here

TOP

Related Classes of net.sf.cram.io.DefaultBitInputStream

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.