早上好,我有一个严重的问题。
我需要读取十六进制文件并将其转换为ascii。
我还需要在另一个文件上写ascii。
我试过了:
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws FileNotFoundException, IOException {
FileInputStream in = new FileInputStream("fileAscii");
int read;
String hex = "";
int count = 0;
String valueRead="";
PrintWriter writer= new PrintWriter("fileOutput");
while ((read = in.read()) != -1) {
count++;
valueRead= Integer.toHexString(read);
if(valueRead.length()==1){
hex=hex+"0";
}
hex = hex + valueRead;
if (is16Multipler(count)) {
System.out.println(hex);
String sb = "";
Str