当我使用数据输出流在 java 中写入文件时,浮点值包含额外的字符:
DataOutputStream writer = new DataOutputStream(new FileOutputStream(fileName));
String output ="This part has no extra characters"
writer.writeBytes(output);
writer.writeFloat(entry.getValue().floatValue());
writer.writeBytes("Neither does this. Only the float has extra characters which are visible in vim and not visible when I cat the file\n");
如何从浮点值中删除多余的字符?