我希望有人能够帮助我,我需要从下面的方法传递一个字符串到下面的方法。我已经看过interent,并开始测试程序,但似乎无法让我的工作,它已经3个小时,3页谷歌和一本书哈哈。对不起,如果这很容易,但我真的不知道。
我需要做的是......我需要将方法“WMDBAudio”中的变量“Hex”传递给方法“hexConverter”。我希望这是有道理的,感谢您提前给予的帮助,它已经过去了!
public class WMDBAudio{
public String WMDBAudio1(String fileInfo) throws IOException{
//code removed as there is quite a lot
int m = 0;
while (m != 1){
for (int count = 0; count < 3; count++){
hexIn = in.read();
s = Integer.toHexString(hexIn);
if(s.length() < 2){
s = "0" + Integer.toHexString(hexIn);
}
temp = temp + s;
}
if ("000000".equalsIgnoreCase(temp)){
m = 1;
hex = entry;
}
entry = entry + temp;
temp = "";
}
}
}// Hex Converter方法
public class hexConverter{
public static void hexConverter(String t){
WMDBAudio w = new WMDBAudio();
String hex = "";
StringBuilder output = new StringBuilder();
for (int i = 0; i < hex.length(); i+=2){
String str = hex.substring(i, i+2);
output.append((char)Integer.parseInt(str, 16));
}
System.out.println(output);
}
}