public static byte[] stringArray2byteArray(String[] strs) {
来源:互联网 发布:天然工坊系统源码 编辑:程序博客网 时间:2024/05/02 00:47
public static byte[] stringArray2byteArray(String[] strs) {
if (strs == null) {
return null;
}
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(byteOutput);
try {
for (int i = 0; i < strs.length; i++) {
byte[] data;
try {
data = strs[i].getBytes("utf-8");
} catch (java.io.UnsupportedEncodingException e) {
data = strs[i].getBytes();
}
out.writeInt(data.length);
out.write(data);
}
out.flush();
byte[] ret = byteOutput.toByteArray();
out.close();
byteOutput.close();
return ret;
} catch (IOException e) {
return null;
}
}
- public static byte[] stringArray2byteArray(String[] strs) {
- public static String toHexStr(byte[] key) {
- public static byte[] hexToBytes(String hexStr) {
- public static String byte2Unicode(byte by[]) {
- public static byte[] Unicode2Byte(String s) {
- public static byte[] convertUnicode2UTF8Byte(String instr) {
- public static String[] byteArray2StringArray(byte[] raw) {
- public static String utf8Byte2String
- public static void main(String[] args) 分析
- public static void main(String [] args)
- public Static void main(String[]args){
- public static String getProcessName(Context context) {
- public static File createNewFile(String filePath)
- public static void main(String[] args)
- 浅谈 public static void main(String[] args)
- 关于public static void main(String[] args)
- public static void main(String[] args){…}
- public static void main(String[] arg)
- erlang behaviour小结之gen_server OTP入门
- Poj 1111 Image Perimeters
- Http的KeepAlive
- 数据库 总结1
- Integer和int的区别
- public static byte[] stringArray2byteArray(String[] strs) {
- lpFindFileData
- zju1203最小生成树(克鲁斯卡尔算法)
- 第一篇 android架构是如何满足设计目标的?
- 使用probe监控jboss
- capistrano 部署rails
- 一周总结,开始新的一天
- public static String[] byteArray2StringArray(byte[] raw) {
- Android权限之sharedUserId和签名