byte[] getBytes() Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a new byte array. byte[] getBytes(Charset charset) Encodes this String into a sequence of bytes using the given charset, storing the result into a new byte array. byte[] getBytes(String charsetName)Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte array.
使用指定的字符集将此 String 编码为 byte 序列,并将结果存储到一个新的 byte 数组中
byte[] getBytes(Charset charset) Encodes this String into a sequence of bytes using the given charset, storing the result into a new byte array.
byte[] getBytes(String charsetName)Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte array.
转换到字符数组
byte[] getBytes()
转换到字节数组