ByteArrayInputStream bis = new ByteArrayInputStream(buf);
BufferedInputStream bufIS = new BufferedInputStream(bis);
BufferedOutputStream bos = new BufferedOutputStream(out);
for(int b = bufIS.read(); b != -1; b = bufIS.read()){
bos.write(b);
}
private byte[] getByteData(File file) {
byte[] data = (byte[])null;
if (file == null) {
return data;
}
FileInputStream fin = null;
try {
fin = new FileInputStream(file);
BufferedInputStream bfStream = new BufferedInputStream(fin);
ByteArrayOutputStream byOutput = new ByteArrayOutputStream();
for (int by = bfStream.read(); by != -1; by = bfStream.read()) {
byOutput.write(by);
}
data = byOutput.toByteArray();
byOutput.close();
bfStream.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
fin.close();
} catch (Exception localException2) {
}
}
return data;
}