oracle blob转txt
2015-08-26 16:44
423 查看
/** * 读取txt文件的内容 * * @param blob * @return * @see [类、类#方法、类#成员] */ public static String txt2String(Blob blob) { String result = ""; try { InputStream input = blob.getBinaryStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int i = -1; while ((i = input.read()) != -1) { baos.write(i); } // 关闭流,不可少 if (input != null) input.close(); return baos.toString("GBK"); /* * byte[] buffer = new byte[1024]; int n = -1; // 遍历,开始下载 while ((n = input.read(buffer, 0, 1024)) > -1) { * result = result + "\n" + new String(buffer, 0, n); } */ } catch (Exception e) { e.printStackTrace(); } // System.out.println(result); return result; }
相关文章推荐
- C#实现txt定位指定行完整实例
- TXT转HTM、HTML「TXT转网页」的vbs实现代码
- C#处理文本文件TXT实例详解
- VC++在TXT文件指定位置追加内容的方法
- C#实现把txt文本数据快速读取到excel中
- 与MSSQL对比学习MYSQL的心得(四)--BLOB数据类型
- 什么是blob,mysql blob大小配置介绍
- MySQL中TEXT与BLOB字段类型的区别
- php中将一段数据存到一个txt文件中并显示其内容
- 通过sql语句将blob里的char取出来转成数字保存在其它字段
- PHP读取txt文本文件并分页显示的方法
- Java导出txt文件的方法
- Python中使用不同编码读写txt文件详解
- python读取TXT到数组及列表去重后按原来顺序排序的方法
- Python实现将目录中TXT合并成一个大TXT文件的方法
- 教你做个txt炸弹
- ORACLE PL/SQL LOB大对象
- Blob Clob
- txt 合并命令
- jdbc 使用PreparedStatement来存储和读取大数据(Blob或Clob)