899091929394959697
Output output = outputThreadLocal.get(); try { kryoThreadLocal.get().writeClassAndObject(output, message); return ByteBuffer.wrap(output.toBytes()); } finally { output.clear(); } } }
96979899100101102103104105106
} @Override public byte[] write(Object object) { final Output out = getOutput(); out.clear(); kryo.writeClassAndObject(out, object); out.flush(); return out.toBytes(); }
125126127128129130131132133134135
} @Override public void write(OutputStream os, Object object) { final Output out = getOutput(); out.clear(); out.setOutputStream(os); kryo.writeClassAndObject(out, object); out.flush(); out.setOutputStream(null); }