我有一个填充了字节的文本字段。当我调用 String s = textfield.getText(); 默认情况下,它是它返回的字节的字符串数据类型。我想获取文本字段中的实际字节作为数据类型字节。但如果我执行 s.getbyte,我会将字节转换为新字节。请谁能帮助我。
//this gives me another bye than the one in the text field.
String ss = new String(Textfield().getText().getBytes(), "UTF-8");
//i want to get something like this
byte [] b = Textfield().getText(); //without geting a new byte
String ss = new String(Textfield().getText().getBytes(), "UTF-8");