編集:解決済み変数を範囲外に宣言しました。基本的なJavaのエラー処理と変数エラー
cannot find symbol
symbol : variable bos
location: class steganography
byte[] bytes = bos.toByteArray();
問題のあるコード::より多くの情報を提供していないため
//We'll use this to read the file in
FileInputStream fis = new FileInputStream(file);
//We'll use this to push the file out
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {
for (int readNum; (readNum = fis.read(buf)) != -1;) {
bos.write(buf, 0, readNum);
//no doubt here is 0
/*Writes len bytes from the specified byte array starting at offset off to this byte array output stream.*/
System.out.println("read " + readNum + " bytes,");
}
} catch (IOException ex) {
System.out.println(ex);
//Logger.getLogger(ConvertImage.class.getName()).log(Level.SEVERE, null, ex);
}
申し訳ありませんが、私はJavaのN00Bだと言うことコンパイルしようとしたときに
は、だから私はエラーを取得します。
カット&ペーストしたルーチンに違反コードが表示されないため、アドバイスはできません。私の推測では、それはスコープの問題です:変数名はそのコンテキストでは見えるが、そうではないと思います。 – duffymo