Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6623

[classlib][archive]Deflater.setlevel/setStrategy throws IllegalStateException if inputBuffer is not null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 6.0M3, 5.0M15
    • None
    • Windows/Linux

    Description

      Please consider the below testcase [1] . RI works fine. But Harmony throws IllegalStateException.

      This is the same case with defl.setStrategy() function also.

      [1] public void test () {
      byte[] byteArray = new byte[100];
      InputStream inFile = new FileInputStream(new File("Input.txt"));
      //input.txt - any text file with some text in it.
      inFile.read(byteArray);
      inFile.close();
      Deflater defl = new Deflater();
      byte[] outPutBuf = new byte[500];
      defl.setInput(byteArray);
      defl.setLevel(2);
      while (!defl.needsInput())

      { defl.deflate(outPutBuf); }
      defl.finish();
      while (!defl.finished()) { defl.deflate(outPutBuf); }

      int totalOut;
      totalOut = defl.getTotalOut();
      System.out.println("TotalOut=" + totalOut);
      }

      Attachments

        1. HARMONY-6623.patch
          2 kB
          Mohanraj Loganathan

        Activity

          People

            odeakin Oliver Deakin
            mohlogan Mohanraj Loganathan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: