JDK-4217782 : Replacement for java.io.StringBufferInputStream? StringReader is no InputStream!
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.1.7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1999-03-05
  • Updated: 1999-05-18
  • Resolved: 1999-05-18
Related Reports
Duplicate :  
Description

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)
======================================================================

Comments
WORK AROUND Name: dbT83986 Date: 03/05/99 leave the deprecated class in the code ... ======================================================================
11-06-2004