String的getBytes()方法可以將一個字符串轉換為一個byte數(shù)組。該方法有多個重載形式,其中一個常用的形式是getBytes(String charsetName),該方法將字符串按照指定的字符集編碼為byte數(shù)組。 例如,將字符串\Hello, world!\轉換為byte數(shù)組: 1 String str = \Hello, world!\byte[] bytes = str.getBytes(); getBytes(...
www.dbjr.com.cn/program/2938983...htm 2025-6-5