@Override public E read(Excerpt bytes) { E e; try { e = (E) UnsafeExcerpt.UNSAFE.allocateInstance(classMarshaled); e.readExternal(bytes); } catch (Exception e2) { throw new IllegalStateException(e2); } return e; }
/** * Writes externalizable object. * * @param obj Object. * @throws IOException In case of error. */ void writeExternalizable(Object obj) throws IOException { Externalizable extObj = (Externalizable)obj; extObj.writeExternal(this); }
final Queue<Step> steps = new ArrayDeque<Step>(); final StepObjectOutput soo = new StepObjectOutput(steps); externalizable.writeExternal(soo); soo.doFinish(); ((Externalizable) clone).readExternal(new StepObjectInput(steps)); } else if (serializabilityChecker.isSerializable(clonedClass)) { Class<?> nonSerializable;
@Override public void writeObject(ObjectOutput output, T object) throws IOException { object.writeExternal(output); }
@Override public T readObject(ObjectInput input) throws IOException, ClassNotFoundException { PrivilegedExceptionAction<T> action = new PrivilegedExceptionAction<T>() { @Override public T run() throws InstantiationException, IllegalAccessException { return ExternalizableExternalizer.this.getTargetClass().newInstance(); } }; try { T object = WildFlySecurityManager.doChecked(action); object.readExternal(input); return object; } catch (PrivilegedActionException e) { throw new IOException(e.getCause()); } }
@Override public void write(Excerpt bytes, @NotNull E e) { try { e.writeExternal(bytes); } catch (IOException e2) { throw new IllegalStateException(e2); } }
extObj.readExternal(this);
public static byte[] toBytes(Externalizable o) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(baos); o.writeExternal(out); out.flush(); return baos.toByteArray(); } }
InputStream is = dh.getInputStream(); if (is != null) { ((Externalizable)new_bean).readExternal( new ObjectInputStream(is));
((Externalizable)res).writeExternal(out); item.writeExternal(out);
protected Object instantiateAndReadNoSer(Class c, FSTClazzInfo clzSerInfo, FSTClazzInfo.FSTFieldInfo referencee, int readPos) throws Exception { Object newObj; newObj = clzSerInfo.newInstance(getCodec().isMapBased()); if (newObj == null) { throw new IOException(referencee.getDesc() + ":Failed to instantiate '" + c.getName() + "'. Register a custom serializer implementing instantiate or define empty constructor.."); } if ( clzSerInfo.isExternalizable() ) { getCodec().ensureReadAhead(readExternalReadAHead); ((Externalizable)newObj).readExternal(this); getCodec().readExternalEnd(); } else { FSTClazzInfo.FSTFieldInfo[] fieldInfo = clzSerInfo.getFieldInfo(); readObjectFields(referencee, clzSerInfo, fieldInfo, newObj,0,0); } return newObj; }
public void defaultWriteObject(Object toWrite, FSTClazzInfo serializationInfo) throws IOException { if ( serializationInfo.isExternalizable() ) { getCodec().ensureFree(writeExternalWriteAhead); ((Externalizable) toWrite).writeExternal(this); } else { FSTClazzInfo.FSTFieldInfo[] fieldInfo = serializationInfo.getFieldInfo(); writeObjectFields(toWrite, serializationInfo, fieldInfo, 0, 0); } }
externalizable.readExternal(objectInput); objectInput.popCallback(); return serializationMembers.callReadResolve(externalizable);
public void defaultWriteObject(Object toWrite, FSTClazzInfo serializationInfo) throws IOException { if ( serializationInfo.isExternalizable() ) { getCodec().ensureFree(writeExternalWriteAhead); ((Externalizable) toWrite).writeExternal(this); } else { FSTClazzInfo.FSTFieldInfo[] fieldInfo = serializationInfo.getFieldInfo(); writeObjectFields(toWrite, serializationInfo, fieldInfo, 0, 0); } }
protected Object instantiateAndReadNoSer(Class c, FSTClazzInfo clzSerInfo, FSTClazzInfo.FSTFieldInfo referencee, int readPos) throws Exception { Object newObj; newObj = clzSerInfo.newInstance(getCodec().isMapBased()); if (newObj == null) { throw new IOException(referencee.getDesc() + ":Failed to instantiate '" + c.getName() + "'. Register a custom serializer implementing instantiate or define empty constructor.."); } if ( clzSerInfo.isExternalizable() ) { getCodec().ensureReadAhead(readExternalReadAHead); ((Externalizable)newObj).readExternal(this); getCodec().readExternalEnd(); } else { FSTClazzInfo.FSTFieldInfo[] fieldInfo = clzSerInfo.getFieldInfo(); readObjectFields(referencee, clzSerInfo, fieldInfo, newObj,0,0); } return newObj; }
externalizable.writeExternal(objectOutput); objectOutput.popCallback(); } catch (IOException e) {
((Externalizable)newObj).readExternal(this); getCodec().readExternalEnd(); if ( clzSerInfo.getReadResolveMethod() != null ) {
((Externalizable) object).writeExternal(this); if (noBlockData) { primitiveTypes = null;
obj.readExternal(blockUnmarshaller); blockUnmarshaller.readToEndBlockData(); blockUnmarshaller.unblock();
writeExternalizableClass(objClass); instanceCache.put(obj, instanceSeq++); ext.writeExternal(objectOutput); writeEndBlock(); if (unshared) {