Examples of BitInputStream


Examples of info.ata4.io.streams.BitInputStream

        if (pbv.numItems == 0 || pbv.bitSize == 0) {
            return new int[]{};
        }
       
        // the values are packed with a variable bit length
        BitInputStream bis = new BitInputStream(new ByteBufferInputStream(pbv.data));
        bis.setBitLength(pbv.bitSize);
       
        int numItems = pbv.numItems.intValue();
        int[] items = new int[numItems];
        for (int i = 0; i < items.length; i++) {
            items[i] = bis.read();
        }
       
        return items;
    }
View Full Code Here

Examples of ivory.core.compression.BitInputStream

    public Reader(byte[] bytes, int n) throws IOException {
      this.termCnt = n;
      if (termCnt > 0) {
        bytesIn = new ByteArrayInputStream(bytes);
        bitsIn = new BitInputStream(bytesIn);
      }
    }
View Full Code Here

Examples of ivory.core.compression.BitInputStream

    @Override
    public void reset() {
      try {
        bytesIn.reset();
        bitsIn = new BitInputStream(bytesIn);
        p = -1;
        prevTf = -1;
        needToReadPositions = false;
      } catch (IOException e) {
        throw new RuntimeException(e);
View Full Code Here

Examples of ivory.core.compression.BitInputStream

    private PostingsList postingsList;

    public PostingsReader(byte[] bytes, int n, int collectionSize,
        PostingsListDocSortedPositional list) throws IOException {
      bytesIn = new ByteArrayInputStream(bytes);
      bitsIn = new BitInputStream(bytesIn);
      if (n <= 0) {
        throw new RuntimeException("Invalid number of postings: " + n);
      }
      innerNumPostings = n;
      if (collectionSize <= 0) {
View Full Code Here

Examples of ivory.core.compression.BitInputStream

    @Override
    public void reset() {
      try {
        bytesIn.reset();
        bitsIn = new BitInputStream(bytesIn);
        cnt = 0;
        needToReadPositions = false;
      } catch (IOException e) {
        e.printStackTrace();
        throw new RuntimeException("Error resetting postings.");
View Full Code Here

Examples of ivory.core.compression.BitInputStream

      Preconditions.checkNotNull(bytes);
      Preconditions.checkArgument(numPostings > 0);
      Preconditions.checkArgument(collectionSize > 0);

      bytesIn = new ByteArrayInputStream(bytes);
      bitsIn = new BitInputStream(bytesIn);
      innerNumPostings = numPostings;
      innerCollectionSize = collectionSize;
      innerGolombParam = (int) Math.ceil(0.69 * ((float) innerCollectionSize)
          / (float) innerNumPostings);
      postingsList = list;
View Full Code Here

Examples of ivory.core.compression.BitInputStream

    @Override
    public void reset() {
      try {
        bytesIn.reset();
        bitsIn = new BitInputStream(bytesIn);
        cnt = 0;
      } catch (IOException e) {
        e.printStackTrace();
        throw new RuntimeException("Error resetting postings.");
      }
View Full Code Here

Examples of ivory.core.compression.BitInputStream

      Preconditions.checkNotNull(bytes);
      Preconditions.checkArgument(numPostings > 0);
      Preconditions.checkArgument(collectionSize > 0);

      bytesIn = new ByteArrayInputStream(bytes);
      bitsIn = new BitInputStream(bytesIn);

      innerNumPostings = numPostings;
      innerCollectionSize = collectionSize;
      innerGolombParam = (int) Math.ceil(0.69 * ((float) innerCollectionSize)
          / (float) innerNumPostings);
View Full Code Here

Examples of ivory.core.compression.BitInputStream

    @Override
    public void reset() {
      try {
        bytesIn.reset();
        bitsIn = new BitInputStream(bytesIn);
        cnt = 0;
        needToReadPositions = false;
      } catch (IOException e) {
        e.printStackTrace();
        throw new RuntimeException("Error resetting postings.");
View Full Code Here

Examples of ivory.core.compression.BitInputStream

    public Reader(byte[] bytes, int n) throws IOException {
      this.termCnt = n;
      if (termCnt > 0) {
        bytesIn = new ByteArrayInputStream(bytes);
        bitsIn = new BitInputStream(bytesIn);
      }
    }
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.