我有一个Bundle
并将它作为字节数组存储到磁盘中。现在,当我检索它时,我会使用字节数组。我怎样才能再次将其转换为Bundle
?
byte fileContent[] = new byte[(int)file.length()];
int numerOfReturnedbytes = 0;
try {
//read the stream and set it into the byte array readFileByteArray
//and returns the numerOfReturnedbytes. If returns -1 means that
//that the end of the stream has been reached.
numerOfReturnedbytes = fis.read(fileContent);
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
if (numerOfReturnedbytes == -1) {
return;
} else {
//creating empty parcel object
Parcel parcel = Parcel.obtain();
//un-marshalling the data contained into the byte array to the parcel
parcel.unmarshall(fileContent, 0, numerOfReturnedbytes);
}
是fileContent
字节数组。关于如何解决我的问题的任何想法?