/** {@inheritDoc} */ @Override protected <T> T unmarshal0(byte[] bytes, @Nullable ClassLoader clsLdr) throws IgniteCheckedException { return impl.deserialize(bytes, clsLdr); }
/** {@inheritDoc} */ @Override protected <T> T unmarshal0(InputStream in, @Nullable ClassLoader clsLdr) throws IgniteCheckedException { ByteArrayOutputStream buf = new ByteArrayOutputStream(); // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that // returns number of bytes remaining. try { byte[] arr = new byte[4096]; int cnt; while ((cnt = in.read(arr)) != -1) buf.write(arr, 0, cnt); buf.flush(); return impl.deserialize(buf.toByteArray(), clsLdr); } catch (IOException e) { throw new BinaryObjectException("Failed to unmarshal the object from InputStream", e); } }
/** {@inheritDoc} */ @Override protected <T> T unmarshal0(byte[] bytes, @Nullable ClassLoader clsLdr) throws IgniteCheckedException { return impl.deserialize(bytes, clsLdr); }
/** {@inheritDoc} */ @Override protected <T> T unmarshal0(InputStream in, @Nullable ClassLoader clsLdr) throws IgniteCheckedException { ByteArrayOutputStream buf = new ByteArrayOutputStream(); // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that // returns number of bytes remaining. try { byte[] arr = new byte[4096]; int cnt; while ((cnt = in.read(arr)) != -1) buf.write(arr, 0, cnt); buf.flush(); return impl.deserialize(buf.toByteArray(), clsLdr); } catch (IOException e) { throw new BinaryObjectException("Failed to unmarshal the object from InputStream", e); } }