Replacement for java.io.StringBufferInputStream? StringReader is no InputStream!

XMLWordPrintable

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



      Name: dbT83986 Date: 03/05/99


      java.io.StringBufferInputStream is deprecated. In the API docs,
      the class java.io.StringReader is referenced. But how to convert
      this to an InputStream? I need one for PreparedStatement.setAsciiStream:

                  java.sql.PreparedStatement ps = _connection.prepareStatement(update);
                  String sval = (String)value;
                  java.io.StringBufferInputStream sbis = new java.io.StringBufferInputStream(sval);
                  ps.setAsciiStream(1,sbis,sval.length()); //1 = first ?
                  result = ps.executeUpdate();
                  ps.close();

      Like most other deprecated things, the java.io.java.io.StringBufferInputStream
      should also have an example how to replace it 1:1
      (Review ID: 54538)
      ======================================================================

            Assignee:
            Mark Reinhold
            Reporter:
            Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: