salve ragazzi mi dite se riesco a leggere corretamente un array di byte?
codice:
int m_input = 9096;
int len;
InputStream resourceInputStream =new ByteArrayInputStream(file1.getContents());
InputStream istream = new BufferedInputStream(resourceInputStream);
byte[] buffer = new byte[m_input];
while (true) {
try {
len = istream.read(buffer);
if (len == -1) {
break;
}
AllFile.add(buffer);
} catch (IOException e) {
len = -1;
break;
}
}
// fine
/* Destination.setContents(file1.getContents());
cmsObj.lockResource(sitePath);
cmsObj.writeFile(Destination);
cmsObj.unlockResource(sitePath);*/
}
Man mano che leggo il file di byte(file1.getbyte) devo iserire ogni riga di byte in un arraylist....è corretto il codice? Perche non mi legge tutto il file, ma solo una parte
grazie