第一种方式:使用字符流 Blob data = new Blob(); InputStream stream = data.getBinaryStream(); byte[] bytes = new byte[(int) data.length()]; stream.read(bytes); String s = new String(bytes); System.out.println(s); 第二种方式:使用字符缓冲区 byte[] bytes2 = data.getBytes(1, (int) data.length()); System.out.println(new String(bytes2, StandardCharsets.UTF_8));
java blob转string
最新推荐文章于 2024-07-19 17:37:28 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)