@Override public <T> byte[] writeObject(T obj) { ByteArrayOutputStream buf = OutputStreams.getByteArrayOutputStream(); ObjectOutputStream output = null; try { output = Outputs.getOutput(buf); output.writeObject(obj); output.flush(); return buf.toByteArray(); } catch (IOException e) { ThrowUtil.throwException(e); } finally { if (output != null) { try { output.close(); } catch (IOException ignored) {} } OutputStreams.resetBuf(buf); } return null; // never get here }
@Override public <T> byte[] writeObject(T obj) { ByteArrayOutputStream buf = OutputStreams.getByteArrayOutputStream(); ObjectOutputStream output = null; try { output = Outputs.getOutput(buf); output.writeObject(obj); output.flush(); return buf.toByteArray(); } catch (IOException e) { ThrowUtil.throwException(e); } finally { if (output != null) { try { output.close(); } catch (IOException ignored) {} } OutputStreams.resetBuf(buf); } return null; // never get here }
@Override public <T> byte[] writeObject(T obj) { ByteArrayOutputStream buf = OutputStreams.getByteArrayOutputStream(); Hessian2Output output = Outputs.getOutput(buf); try { output.writeObject(obj); output.flush(); return buf.toByteArray(); } catch (IOException e) { ThrowUtil.throwException(e); } finally { try { output.close(); } catch (IOException ignored) {} OutputStreams.resetBuf(buf); } return null; // never get here }
@Override public <T> byte[] writeObject(T obj) { ByteArrayOutputStream buf = OutputStreams.getByteArrayOutputStream(); Hessian2Output output = Outputs.getOutput(buf); try { output.writeObject(obj); output.flush(); return buf.toByteArray(); } catch (IOException e) { ThrowUtil.throwException(e); } finally { try { output.close(); } catch (IOException ignored) {} OutputStreams.resetBuf(buf); } return null; // never get here }
@Override public <T> byte[] writeObject(T obj) { ByteArrayOutputStream buf = OutputStreams.getByteArrayOutputStream(); ObjectOutputStream output = null; try { output = Outputs.getOutput(buf); output.writeObject(obj); output.flush(); return buf.toByteArray(); } catch (IOException e) { ThrowUtil.throwException(e); } finally { if (output != null) { try { output.close(); } catch (IOException ignored) {} } OutputStreams.resetBuf(buf); } return null; // never get here }
@Override public <T> byte[] writeObject(T obj) { ByteArrayOutputStream buf = OutputStreams.getByteArrayOutputStream(); Hessian2Output output = Outputs.getOutput(buf); try { output.writeObject(obj); output.flush(); return buf.toByteArray(); } catch (IOException e) { ThrowUtil.throwException(e); } finally { try { output.close(); } catch (IOException ignored) {} OutputStreams.resetBuf(buf); } return null; // never get here }
@Override public <T> byte[] writeObject(T obj) { ByteArrayOutputStream buf = OutputStreams.getByteArrayOutputStream(); Hessian2Output output = Outputs.getOutput(buf); try { output.writeObject(obj); output.flush(); return buf.toByteArray(); } catch (IOException e) { ThrowUtil.throwException(e); } finally { try { output.close(); } catch (IOException ignored) {} OutputStreams.resetBuf(buf); } return null; // never get here }