使用byteArrayOutputStream

问题描述

我需要使用byteArrayOutputStream将中文字符转换为字节数组。

I have tried below option,but after write method I can not see the proper value in byteArrayOutputStream.

byteArrayOutputStream.write(header.getBytes());
byteArrayOutputStream.write(header.getBytes("UTF-16"));
byteArrayOutputStream.write(header.getBytes("UTF-8"));

Input: 5-28_Release_Org,库房名称,Test_Stockroom,用户名,Perf104 test,供应商名称,VWR,采购订单

Current output: 组织  5-28_Release_Org    库房å称    Test_Stockroom  ç”¨æˆ·å   Perf104 test    供应商å称 VWR 采购订å•

Expected output in byteArrayOutputStream: 5-28_Release_Org,采购订单

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)