我有一个使用Object ArrayList获得的byte []
谁能告诉我如何将我的byte []转换为Object ArrayList?
像这样垂涎arraylist
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = null;
oos = new ObjectOutputStream(bos);
oos.writeObject(mArrayList);//mArrayList is the array to convert
byte[] buff = bos.toByteArray();
Run Code Online (Sandbox Code Playgroud)谢谢!
Jon*_*eet 18
现在您已经向我们提供了有关您如何以某种方式进行转换的信息......您需要:
ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes));
try {
@SuppressWarnings("unchecked")
ArrayList<Object> list = (ArrayList<Object>) ois.readObject();
...
} finally {
ois.close();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12138 次 |
| 最近记录: |