new getReader() method in java.net.URLConnection

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.1
    • Component/s: core-libs
    • generic
    • generic



      Name: jn10789 Date: 11/18/98


      Trying to apply the java.io.StreamTokenizer to a textual configuration file given as an URL, like it is done in the AWT demos WireFrame and MoleculeViewer, you will encounter the following problem:
      java.net.URLConnection provides only a method getInputStream() for opening the file. Unfortunately, the constructor StreamTokenizer(InputStream is) is now deprecated for internal reasons, as ###@###.### wrote me.
      So you would be forced to use some code like this:

          Reader isr = new InputStreamReader(urlConn.getInputStream());
          StreamTokenizer st = new StreamTokenizer(isr);

      This piece of work hasn't been included in the deprecated constructor of StreamTokenizer because the buffered InputStreamReader behaves slightly different than the non-buffered InputStream.
      So we both agreed, that it would be a good idea to let URLConnection provide a proprietary method getReader() as described below in the workaround field:
      (Review ID: 37346)
      ======================================================================

            Assignee:
            Unassigned
            Reporter:
            Jeffrey Nisewanger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: