Редактировать: Решено Я объявил переменную вне области видимости.
Итак, я получаю сообщение об ошибке при попытке компилировать:
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.