public void run() {
    byte[] buf = new byte[32];

    int bytes_read;

    try {
      int b = sbis.read();
      out.write(b);

      while ((bytes_read = sbis.read(buf)) != -1) out.write(buf, 0, bytes_read);

      out.close();
    } catch (IOException e) {
      System.out.println("FAILED: Basic piped stream test: " + e);
    }
  }
Esempio n. 2
0
 public void setClobValue(int iindex, String value, PreparedStatement pstmt) throws SQLException {
   if (value == null) value = "";
   StringBufferInputStream sbis = new StringBufferInputStream(value);
   pstmt.setAsciiStream(iindex, sbis, sbis.available());
 }