InputStream inputStream = null; ObjectInputStream objectStream = null; try { inputStream = Lib.byteBufferToInputStream(buffer); if (inputStream != null) { objectStream = new ObjectInputStream(inputStream); obj = objectStream.readObject(); } } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } finally { try { if (inputStream != null) { inputStream.reset(); } } catch (IOException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } try { if (objectStream != null) { objectStream.close(); } } catch (IOException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } }