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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.7
    • 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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: