String
public String(byte[] bytes)Constructs a new String by decoding the specified array of bytes using the platform's default charset. The length of the new String is a function of the charset, and hence may not be equal to the length of the byte array. The behavior of this constructor when the given bytes are not valid in the default charset is unspecified. The CharsetDecoder class should be used when more control over the decoding process is required.
Parameters:
bytes - the bytes to be decoded into characters
Since:
JDK1.1
public String(byte[] bytes)Constructs a new String by decoding the specified array of bytes using the platform's default charset. The length of the new String is a function of the charset, and hence may not be equal to the length of the byte array. The behavior of this constructor when the given bytes are not valid in the default charset is unspecified. The CharsetDecoder class should be used when more control over the decoding process is required.
Parameters:
bytes - the bytes to be decoded into characters
Since:
JDK1.1
解决方案 »
- 用Java + jsp做项目有什么优点?????????????
- hibernate-CRM系统跟据员工ID查管理权限HQL怎么写?
- 问:java如果得到服务端session中所有用户???
- 这样的查找如何写?
- (急用)java EL表达式问题
- 关于getParameterValues的一个非常奇怪的问题
- 想写一个jsp新闻发布系统用的html编辑器。可是不知道 怎么写!急………………………………在线等!
- 简单问题!散分了!散分了!散分了!散分了!
- jive安装后,如何设置显示中文?
- 请问在JSP里面怎样将字符'2001-07-24 13:10' 转化成日期型数据,并对两个日期怎样进行比较?
- 查找了相关资料没能解决的关于Servlet 连接数据库的问题!求救!!!!!!!!!!!!!
- 一个很郁闷的问题,高分求教
但是如果复杂了以后,就不行了,具体复杂到什么程度不行我就不知道了,反正楼上的不对
因为一般来说数据库字段使用了数据流的都是大对象,例如序列化的Object或者Image,取出来的byte[]需要保存成对应的对象才可以,,
谁能不能发个例子示例一下,好学习一下呀
response.setContentType("application/msword");
OutputStream out=response.getOutputStream();
out.write(byte[]);
InputStream in = rs.getBinaryStream(word字段);
OutputStream out = response.getOutputStream();
byte[] bytes = new byte[4096];
while(in.read(bytes,0,4096) != -1){
out.write(bytes);
}
out.flush();
in.close();
out.close();