getBytes public byte[] getBytes() Convert this String into bytes according to the platform's default character encoding, storing the result into a new byte array. Returns: the resultant byte array. Since: JDK1.1 摘自java的帮助文档,多看看文档对学java帮助很大。
getBytes public byte[] getBytes() Convert this String into bytes according to the platform's default character encoding, storing the result into a new byte array. Returns: the resultant byte array. Since: JDK1.1 摘自java的帮助文档,多看看文档对学java帮助很大。
getBytes public byte[] getBytes() Convert this String into bytes according to the platform's default character encoding, storing the result into a new byte array. Returns: the resultant byte array. Since: JDK1.1 多看看java文档,对学习java帮助会很大
byte[] byt =new byte[20];
改为:
String str ="abcdefg";
byte[] byt =str.getBytes();如果不想这样你也可以用个循环来getByte();
public byte[] getBytes()
Convert this String into bytes according to the platform's default character encoding, storing the result into a new byte array.
Returns:
the resultant byte array.
Since:
JDK1.1
摘自java的帮助文档,多看看文档对学java帮助很大。
public byte[] getBytes()
Convert this String into bytes according to the platform's default character encoding, storing the result into a new byte array.
Returns:
the resultant byte array.
Since:
JDK1.1
摘自java的帮助文档,多看看文档对学java帮助很大。
public byte[] getBytes()
Convert this String into bytes according to the platform's default character encoding, storing the result into a new byte array.
Returns:
the resultant byte array.
Since:
JDK1.1
多看看java文档,对学习java帮助会很大
原来不用加参数,谢了,给分!