Package net.sf.cram.io

Examples of net.sf.cram.io.BitInputStream


      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.BitInputStream

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.