Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1195542

InputStreamStringBuffer.read always returns -1

    Details

    • Subcomponent:
    • Resolved In Build:
      1.0alpha2
    • CPU:
      sparc
    • OS:
      solaris_2.4
    • Verification:
      Not verified

      Description

      The read method always returns -1. Here's the code:

       public synchronized int read(byte b[], int off, int len) {
      if (pos >= count) {
      return -1;
      }
      if (pos + len > count) {
      len = count - pos;
      }
      if (len <= 0) {
      return 0;
      }
      String s = buffer;
      int cnt = len;
      while (--cnt >= 0) {
      b[off++] = (byte)s.charAt(pos++);
      }

      return cnt;
          }


      The return statement should return "len" instead of "cnt"

        Attachments

          Activity

            People

            • Assignee:
              sshaiosunw Sami Shaio (Inactive)
              Reporter:
              sshaiosunw Sami Shaio (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: