@Override public <T> T readObject(InputBuf inputBuf, Class<T> clazz) { ObjectInputStream input = null; try { input = Inputs.getInput(inputBuf); Object obj = input.readObject(); return clazz.cast(obj); } catch (Exception e) { ThrowUtil.throwException(e); } finally { if (input != null) { try { input.close(); } catch (IOException ignored) {} } inputBuf.release(); } return null; // never get here }
public static ObjectInputStream getInput(InputBuf inputBuf) throws IOException { return new ObjectInputStream(inputBuf.inputStream()); }
public static Input getInput(InputBuf inputBuf) { if (inputBuf.hasMemoryAddress()) { return new UnsafeNioBufInput(inputBuf.nioByteBuffer(), true); } return new NioBufInput(inputBuf.nioByteBuffer(), true); }
public static Input getInput(InputBuf inputBuf) { ByteBuffer nioBuf = inputBuf.nioByteBuffer(); ByteBufferInput input = new ByteBufferInput(); input.setVarIntsEnabled(false); // Compatible with FastInput input.setBuffer(nioBuf, 0, nioBuf.capacity()); return input; }
public int size() { return (bytes == null ? 0 : bytes.length) + (inputBuf == null ? 0 : inputBuf.size()) + (outputBuf == null ? 0 : outputBuf.size()); } }
public static Input getInput(InputBuf inputBuf) { ByteBuffer nioBuf = inputBuf.nioByteBuffer(); ByteBufferInput input = new ByteBufferInput(); input.setVarIntsEnabled(false); // Compatible with FastInput input.setBuffer(nioBuf, 0, nioBuf.capacity()); return input; }
public int size() { return (bytes == null ? 0 : bytes.length) + (inputBuf == null ? 0 : inputBuf.size()) + (outputBuf == null ? 0 : outputBuf.size()); } }
@Override public <T> T readObject(InputBuf inputBuf, Class<T> clazz) { ObjectInputStream input = null; try { input = Inputs.getInput(inputBuf); Object obj = input.readObject(); return clazz.cast(obj); } catch (Exception e) { ThrowUtil.throwException(e); } finally { if (input != null) { try { input.close(); } catch (IOException ignored) {} } inputBuf.release(); } return null; // never get here }
public static Input getInput(InputBuf inputBuf) { if (inputBuf.hasMemoryAddress()) { return new UnsafeNioBufInput(inputBuf.nioByteBuffer(), true); } return new NioBufInput(inputBuf.nioByteBuffer(), true); }
public static ObjectInputStream getInput(InputBuf inputBuf) throws IOException { return new ObjectInputStream(inputBuf.inputStream()); }
public static Input getInput(InputBuf inputBuf) { ByteBuffer nioBuf = inputBuf.nioByteBuffer(); ByteBufferInput input = new ByteBufferInput(); input.setVarIntsEnabled(false); // Compatible with FastInput input.setBuffer(nioBuf, 0, nioBuf.capacity()); return input; }
public int size() { return (bytes == null ? 0 : bytes.length) + (inputBuf == null ? 0 : inputBuf.size()) + (outputBuf == null ? 0 : outputBuf.size()); } }
@Override public <T> T readObject(InputBuf inputBuf, Class<T> clazz) { Input input = Inputs.getInput(inputBuf); Kryo kryo = kryoThreadLocal.get(); try { return kryo.readObject(input, clazz); } finally { inputBuf.release(); } }
public static Input getInput(InputBuf inputBuf) { if (inputBuf.hasMemoryAddress()) { return new UnsafeNioBufInput(inputBuf.nioByteBuffer(), true); } return new NioBufInput(inputBuf.nioByteBuffer(), true); }
public static Hessian2Input getInput(InputBuf inputBuf) { return new Hessian2Input(inputBuf.inputStream()); }
public static Input getInput(InputBuf inputBuf) { ByteBuffer nioBuf = inputBuf.nioByteBuffer(); ByteBufferInput input = new ByteBufferInput(); input.setVarIntsEnabled(false); // Compatible with FastInput input.setBuffer(nioBuf, 0, nioBuf.capacity()); return input; }
@Override public <T> T readObject(InputBuf inputBuf, Class<T> clazz) { Input input = Inputs.getInput(inputBuf); Kryo kryo = kryoThreadLocal.get(); try { return kryo.readObject(input, clazz); } finally { inputBuf.release(); } }
public static Input getInput(InputBuf inputBuf) { if (inputBuf.hasMemoryAddress()) { return new UnsafeNioBufInput(inputBuf.nioByteBuffer(), true); } return new NioBufInput(inputBuf.nioByteBuffer(), true); }
public static Hessian2Input getInput(InputBuf inputBuf) { return new Hessian2Input(inputBuf.inputStream()); }
@Override public <T> T readObject(InputBuf inputBuf, Class<T> clazz) { Hessian2Input input = Inputs.getInput(inputBuf); try { Object obj = input.readObject(clazz); return clazz.cast(obj); } catch (IOException e) { ThrowUtil.throwException(e); } finally { try { input.close(); } catch (IOException ignored) {} inputBuf.release(); } return null; // never get here }