Here you can find the source of deserializeSafe(byte[] buf, T obj)
public static <T extends Externalizable> void deserializeSafe(byte[] buf, T obj) throws IOException, ClassNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static <T extends Externalizable> void deserializeSafe(byte[] buf, T obj) throws IOException, ClassNotFoundException { ByteArrayInputStream bis = null; try {/*ww w. ja v a 2s . c om*/ bis = new ByteArrayInputStream(buf); ObjectInputStream oin = null; try { oin = new ObjectInputStream(bis); obj.readExternal(oin); } finally { if (oin != null) { try { oin.close(); } catch (IOException e) { /* NOP */ } } } } finally { if (bis != null) { try { bis.close(); } catch (IOException e) { /* NOP */ } } } } }