Harmony
  1. Harmony
  2. HARMONY-6134

[classlib][luni] java.io.BufferedInputStream.reset() throws IOException after skipping the marked position

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0M8
    • Fix Version/s: 5.0M10
    • Component/s: Classlib
    • Labels:
      None
    • Estimated Complexity:
      Moderate

      Description

      Given a test case [1], HY throws IOException after skipping the marked position while RI doesn't.

      If SKIP_VALUE<=5, HY and RI pass the test;
      else HY throws java.lang.IOException [2] but RI also passes this.

      [1] Test Case:
      public void test_skipJ_scenario1() throws IOException

      { byte[] input = "12345678900".getBytes(); BufferedInputStream buffis = new BufferedInputStream( new ByteArrayInputStream(input)); buffis.read(); buffis.mark(5); buffis.skip(SKIP_VALUE); buffis.reset(); }

      public void test_skipJ_scenario2() throws IOException

      { byte[] input = "12345678900".getBytes(); BufferedInputStream buffis = new BufferedInputStream( new ByteArrayInputStream(input)); buffis.mark(5); buffis.skip(SKIP_VALUE + 1); buffis.reset(); }

      [2] Stack Trace:
      java.io.IOException: Mark has been invalidated.
      at java.io.BufferedInputStream.reset(BufferedInputStream.java:351)

        Activity

        Hide
        Tim Ellison added a comment -

        No response, assuming ok.

        Show
        Tim Ellison added a comment - No response, assuming ok.
        Hide
        Tim Ellison added a comment -

        Thanks Kevin.

        Patch applied to LUNI module at repo revision r772257.

        Please verify it was applied as you expected.

        Show
        Tim Ellison added a comment - Thanks Kevin. Patch applied to LUNI module at repo revision r772257. Please verify it was applied as you expected.
        Hide
        Kevin Zhou added a comment -

        Would you please try it?

        Show
        Kevin Zhou added a comment - Would you please try it?

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Kevin Zhou
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development