java string数组转byte数组

是String数组哦~有没有人知道呀~
不好意思啊,条件没给全,我要使String转换后的byte是固定长度的,即数组中的每个String转为byte,不足位补0,谢谢各位大神继续解答


String[] str={1,2,3,4,5,6,7};或者String[] str = new String[]{"aaaa","bbbb","cccc"};
StringBuilder b=new StringBuilder();

for(String s:str){
b.append(s);

}
byte b[] =b.toString.getBytes();
记到给分直接把代码拷去用把
上面的数组你换成自己的
温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-09-02
String str = "Hello";

byte[] srtbyte = str.getBytes();
第2个回答  2014-09-02
String[] s={"121","3213"};
Set<byte[]> buffer=new HashSet<byte[]>();
for(int i=0;i<s.length;i++){
buffer.add(s[i].getBytes());
}
第3个回答  2014-09-02
getBytes. 方法. . . Byte[] result = new String("HellpWOrld").getBytes();
相似回答