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

Method available of class LineNumberInputStream is in e

XMLWordPrintable

    • 1.2beta3
    • sparc
    • solaris_1
    • Not verified

      The definition of available for LineNumberInputStream is

          public int available() throws IOException {
      return (pushBack == -1) ? super.available() : super.available() + 1;
          }

      but it should be

          public int available() throws IOException {
      return (pushBack == -1) ? super.available()/2 : super.available()/2 + 1;
          }

          because if the contained stream can supply n bytes it might turn out
          that LineNumberInputStream can supply only n/2 bytes if the n bytes
          are a pile of \\r\\n pairs, right?

            dviswanasunw Deepa Viswanathan (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: