但我们用varchar 255 来存储数据的时候,可能不够用,甚至使用text也不够,那这个时候就可以使用Blob类型
blob 对应的就是java的byte[] 但是这样数据太长了,所以可以使用ByteBuffer;
前端还是传递一个字符串过来,然后我们把字符串转换成byte[] 存储进ByteBuffer;
String content = applyDto.getContent(); ByteBuffer buffer = ByteBuffer.wrap(content.getBytes()); applyBean.setContent(buffer); //取出来 ByteBuffer转换为字符串 String s = StandardCharsets.UTF_8.decode(buffer).toString(); System.out.println(s);



