标签:put out turn return rac array input tac his
序列化:
ByteArrayOutputStream obj = new ByteArrayOutputStream();
try
{
ObjectOutputStream out = new ObjectOutputStream(obj);
out.writeObject(this);
return obj.toByteArray();
} catch (IOException e)
{
e.printStackTrace();
}
反序列化:
ByteArrayInputStream bin = new ByteArrayInputStream((byte[])objs);
try
{
ObjectInputStream obin = new ObjectInputStream(bin);
Object obj = obin.readObject();
}
catcch(Exception e)
{
e.printStackTrace();
}
标签:put out turn return rac array input tac his
原文地址:http://www.cnblogs.com/flyingcloude/p/6992424.html