Examples of BitInputStream


Examples of org.apache.sanselan.common.BitInputStream

  private void interpretStrip(BufferedImage bi, byte bytes[],
      int pixels_per_strip) throws ImageReadException, IOException
  {
    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
    BitInputStream bis = new BitInputStream(bais);

    for (int i = 0; i < pixels_per_strip; i++)
    {
      int samples[] = getSamplesAsBytes(bis);

      if ((x < width) && (y < height))
      {
        samples = applyPredictor(samples, x);

        photometricInterpreter.interpretPixel(bi, samples, x, y);
      }

      x++;
      if (x >= width)
      {
        x = 0;
        y++;
        bis.flushCache();
        if (y >= height)
          break;
      }
    }
  }
View Full Code Here

Examples of org.apache.sanselan.common.BitInputStream

  private void interpretTile(BufferedImage bi, byte bytes[], int startX,
      int startY) throws ImageReadException, IOException
  {
    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
    BitInputStream bis = new BitInputStream(bais);

    int pixelsPerTile = tileWidth * tileLength;

    int tileX = 0, tileY = 0;

    for (int i = 0; i < pixelsPerTile; i++)
    {

      int x = tileX + startX;
      int y = tileY + startY;

      int samples[] = getSamplesAsBytes(bis);

      if ((x < width) && (y < height))
      {
        samples = applyPredictor(samples, x);
        photometricInterpreter.interpretPixel(bi, samples, x, y);
      }

      tileX++;

      if (tileX >= tileWidth)
      {
        tileX = 0;
        tileY++;
        bis.flushCache();
        if (tileY >= tileLength)
          break;
      }

    }
View Full Code Here

Examples of org.apache.sanselan.common.BitInputStream

    private void interpretStrip(BufferedImage bi, byte bytes[],
            int pixels_per_strip) throws ImageReadException, IOException
    {
        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
        BitInputStream bis = new BitInputStream(bais);

        for (int i = 0; i < pixels_per_strip; i++)
        {
            int samples[] = getSamplesAsBytes(bis);

            if ((x < width) && (y < height))
            {
                samples = applyPredictor(samples, x);

                photometricInterpreter.interpretPixel(bi, samples, x, y);
            }

            x++;
            if (x >= width)
            {
                x = 0;
                y++;
                bis.flushCache();
                if (y >= height)
                    break;
            }
        }
    }
View Full Code Here

Examples of org.apache.sanselan.common.BitInputStream

    private void interpretTile(BufferedImage bi, byte bytes[], int startX,
            int startY) throws ImageReadException, IOException
    {
        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
        BitInputStream bis = new BitInputStream(bais);

        int pixelsPerTile = tileWidth * tileLength;

        int tileX = 0, tileY = 0;

        for (int i = 0; i < pixelsPerTile; i++)
        {

            int x = tileX + startX;
            int y = tileY + startY;

            int samples[] = getSamplesAsBytes(bis);

            if ((x < width) && (y < height))
            {
                samples = applyPredictor(samples, x);
                photometricInterpreter.interpretPixel(bi, samples, x, y);
            }

            tileX++;

            if (tileX >= tileWidth)
            {
                tileX = 0;
                tileY++;
                bis.flushCache();
                if (tileY >= tileLength)
                    break;
            }

        }
View Full Code Here

Examples of org.apache.sanselan.common.BitInputStream

    private void interpretStrip(BufferedImage bi, byte bytes[],
            int pixels_per_strip) throws ImageReadException, IOException
    {
        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
        BitInputStream bis = new BitInputStream(bais);

        for (int i = 0; i < pixels_per_strip; i++)
        {
            int samples[] = getSamplesAsBytes(bis);

            if ((x < width) && (y < height))
            {
                samples = applyPredictor(samples, x);

                photometricInterpreter.interpretPixel(bi, samples, x, y);
            }

            x++;
            if (x >= width)
            {
                x = 0;
                y++;
                bis.flushCache();
                if (y >= height)
                    break;
            }
        }
    }
View Full Code Here

Examples of org.apache.sanselan.common.BitInputStream

    private void interpretTile(BufferedImage bi, byte bytes[], int startX,
            int startY) throws ImageReadException, IOException
    {
        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
        BitInputStream bis = new BitInputStream(bais);

        int pixelsPerTile = tileWidth * tileLength;

        int tileX = 0, tileY = 0;

        for (int i = 0; i < pixelsPerTile; i++)
        {

            int x = tileX + startX;
            int y = tileY + startY;

            int samples[] = getSamplesAsBytes(bis);

            if ((x < width) && (y < height))
            {
                samples = applyPredictor(samples, x);
                photometricInterpreter.interpretPixel(bi, samples, x, y);
            }

            tileX++;

            if (tileX >= tileWidth)
            {
                tileX = 0;
                tileY++;
                bis.flushCache();
                if (tileY >= tileLength)
                    break;
            }

        }
View Full Code Here

Examples of org.kc7bfi.jflac.io.BitInputStream

     * The constructor.
     * @param inputStream    The input stream to read data from
     */
    public FLACDecoder(InputStream inputStream) {
        this.inputStream = inputStream;
        this.bitStream = new BitInputStream(inputStream);
        samplesDecoded = 0;
        //state = DECODER_SEARCH_FOR_METADATA;
    }
View Full Code Here

Examples of org.terrier.compression.BitInputStream

    * @param runNo the number of this run
    * @param _postingInRunClass the class that all postings in this class have
    */ 
  public FileRunIterator(String filename, String termsFile, int runNo, Class<? extends PostingInRun> _postingInRunClass, int fieldCount) throws Exception{
    super(_postingInRunClass, runNo, fieldCount);
    mbis = new BitInputStream(filename);
    stringDIS = new DataInputStream( Files.openFileStream(termsFile) );
    if (Files.length(filename) > 0)
    {
      maxSize = mbis.readGamma();
      size = mbis.readGamma();
View Full Code Here

Examples of org.terrier.compression.BitInputStream

         
            //use a PostingInRun to decompress the postings stored in memory
            final PostingInRun pir = getPostingReader();
            pir.setDf(p.getDocF());
            pir.setTF(p.getTF());
            pir.setPostingSource(new BitInputStream(new ByteArrayInputStream(
              Docs.getMOS().getBuffer())));
            //System.err.println("temp compressed buffer size="+Docs.getMOS().getPos() + " length="+Docs.getMOS().getBuffer().length);
            //decompress the memory postings and write out to the direct file
            pir.append(bos, -1);
          }
View Full Code Here

Examples of org.terrier.compression.BitInputStream

  public PostingInRun next() {
    try{
      /** Current Posting List */
      final MapEmittedPostingList post = postingIterator.next();
      posting.setTerm(term);
      posting.setPostingSource(new BitInputStream(new ByteArrayInputStream(post.getArray())));
      posting.setDf(post.getDocumentFreq());
      posting.setTF(post.getTermFreq());
      mapNo = post.getMap();
      flushNo = post.getFlushNo();
      splitNo = post.getSplitNo();
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.