/** * {@inheritDoc} * @see org.wildfly.clustering.marshalling.spi.MarshalledValue#get(java.lang.Object) */ @SuppressWarnings("unchecked") @Override public synchronized T get(MarshallingContext context) throws IOException, ClassNotFoundException { if (this.object == null) { this.context = context; if (this.bytes != null) { ByteArrayInputStream input = new ByteArrayInputStream(this.bytes); ClassLoader loader = setThreadContextClassLoader(this.context.getClassLoader()); try (SimpleDataInput data = new SimpleDataInput(Marshalling.createByteInput(input))) { int version = IndexSerializer.VARIABLE.readInt(data); try (Unmarshaller unmarshaller = context.createUnmarshaller(version)) { unmarshaller.start(data); this.object = (T) unmarshaller.readObject(); unmarshaller.finish(); this.bytes = null; // Free up memory } } finally { setThreadContextClassLoader(loader); } } } return this.object; }
public SimpleByteDataInput(final InputStream inputStream) { this.input = new SimpleDataInput(Marshalling.createByteInput(inputStream)); }
public SimpleByteDataInput(final InputStream inputStream) { this.input = new SimpleDataInput(Marshalling.createByteInput(inputStream)); }
public SimpleByteDataInput(final InputStream inputStream) { this.input = new SimpleDataInput(Marshalling.createByteInput(inputStream)); }
/** * {@inheritDoc} * @see org.wildfly.clustering.marshalling.spi.MarshalledValue#get(java.lang.Object) */ @SuppressWarnings("unchecked") @Override public synchronized T get(MarshallingContext context) throws IOException, ClassNotFoundException { if (this.object == null) { this.context = context; if (this.bytes != null) { ByteArrayInputStream input = new ByteArrayInputStream(this.bytes); ClassLoader loader = setThreadContextClassLoader(this.context.getClassLoader()); try (SimpleDataInput data = new SimpleDataInput(Marshalling.createByteInput(input))) { int version = IndexSerializer.VARIABLE.readInt(data); try (Unmarshaller unmarshaller = context.createUnmarshaller(version)) { unmarshaller.start(data); this.object = (T) unmarshaller.readObject(); unmarshaller.finish(); this.bytes = null; // Free up memory } } finally { setThreadContextClassLoader(loader); } } } return this.object; }
if (this.bytes != null) { ByteArrayInputStream input = new ByteArrayInputStream(this.bytes); SimpleDataInput data = new SimpleDataInput(Marshalling.createByteInput(input)); int version = data.readInt(); Unmarshaller unmarshaller = context.createUnmarshaller(version);
try { inputStream = FISAction.open(file); SimpleDataInput input = new SimpleDataInput(Marshalling.createByteInput(inputStream)); int version = input.readInt(); MarshallingConfiguration config = this.passivationManager.getMarshallingConfiguration(version);