Here you can find the source of readBlobUTF16BinaryStream(ResultSet rs, String fieldName)
public static String readBlobUTF16BinaryStream(ResultSet rs, String fieldName) throws SQLException
//package com.java2s; import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static String readBlobUTF16BinaryStream(ResultSet rs, String fieldName) throws SQLException { /*try {/*from ww w. j av a 2 s.co m*/ Blob clob = rs.getBlob(fieldName); InputStream is = clob.getBinaryStream(); StringBuffer sb = new StringBuffer(); int readedBytes; int bufferSize = 4096; do { byte[] bytes = new byte[bufferSize]; readedBytes = is.read(bytes); if (readedBytes > 0) { String readed = new String(bytes, 0, readedBytes, "UTF-16"); sb.append(readed); } } while (readedBytes == bufferSize); is.close(); return sb.toString(); } catch (IOException e) { throw new DatabaseException(e); }*/ return null; } }