/** * @return Deserialized value. */ private Object deserializeValue() { return reader(null, true).deserialize(); }
/** * @param fieldId Field ID. * @return Deserialized object. * @throws BinaryObjectException If failed. */ @Nullable Object readField(int fieldId) throws BinaryObjectException { if (!findFieldById(fieldId)) return null; return new BinaryReaderExImpl(ctx, in, ldr, hnds, true).deserialize(); }
/** * @return Object. * @throws BinaryObjectException In case of error. */ @Nullable public static Object doReadObject(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr, BinaryReaderHandlesHolder handles) throws BinaryObjectException { return new BinaryReaderExImpl(ctx, in, ldr, handles.handles(), true).deserialize(); }
/** * @param arr Byte array. * @param ldr Class loader. * @return Deserialized object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @Nullable public <T> T deserialize(byte[] arr, @Nullable ClassLoader ldr) throws BinaryObjectException { assert arr != null; assert arr.length > 0; if (arr[0] == NULL) return null; BinaryContext oldCtx = pushContext(ctx); try { return (T)new BinaryReaderExImpl(ctx, BinaryHeapInputStream.create(arr, 0), ldr, true).deserialize(); } finally { popContext(oldCtx); } }
/** * Runs value deserialization regardless of whether obj already has the deserialized value. * Will set obj if descriptor is configured to keep deserialized values. * @param coCtx CacheObjectContext. * @return Object. */ private Object deserializeValue(@Nullable CacheObjectValueContext coCtx) { BinaryReaderExImpl reader = reader(null, coCtx != null ? coCtx.kernalContext().config().getClassLoader() : ctx.configuration().getClassLoader(), true); Object obj0 = reader.deserialize(); BinaryClassDescriptor desc = reader.descriptor(); assert desc != null; if (coCtx != null && coCtx.storeValue()) obj = obj0; return obj0; }
/** * @return Deserialized value. */ private Object deserializeValue() { return reader(null, true).deserialize(); }
/** * @param fieldId Field ID. * @return Deserialized object. * @throws BinaryObjectException If failed. */ @Nullable Object readField(int fieldId) throws BinaryObjectException { if (!findFieldById(fieldId)) return null; return new BinaryReaderExImpl(ctx, in, ldr, hnds, true).deserialize(); }
/** * @return Object. * @throws BinaryObjectException In case of error. */ @Nullable public static Object doReadObject(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr, BinaryReaderHandlesHolder handles) throws BinaryObjectException { return new BinaryReaderExImpl(ctx, in, ldr, handles.handles(), true).deserialize(); }
/** * @param arr Byte array. * @param ldr Class loader. * @return Deserialized object. * @throws org.apache.ignite.binary.BinaryObjectException In case of error. */ @SuppressWarnings("unchecked") @Nullable public <T> T deserialize(byte[] arr, @Nullable ClassLoader ldr) throws BinaryObjectException { assert arr != null; assert arr.length > 0; if (arr[0] == NULL) return null; BinaryContext oldCtx = pushContext(ctx); try { return (T)new BinaryReaderExImpl(ctx, BinaryHeapInputStream.create(arr, 0), ldr, true).deserialize(); } finally { popContext(oldCtx); } }
/** * Runs value deserialization regardless of whether obj already has the deserialized value. * Will set obj if descriptor is configured to keep deserialized values. * @param coCtx CacheObjectContext. * @return Object. */ private Object deserializeValue(@Nullable CacheObjectValueContext coCtx) { BinaryReaderExImpl reader = reader(null, coCtx != null ? coCtx.kernalContext().config().getClassLoader() : ctx.configuration().getClassLoader(), true); Object obj0 = reader.deserialize(); BinaryClassDescriptor desc = reader.descriptor(); assert desc != null; if (coCtx != null && coCtx.storeValue()) obj = obj0; return obj0; }