private static void writeSlotWithMethod( ClassMetaDataSlot slot, ObjectOutput out, Object obj, ObjectSubstitutionInterface substitution) throws IOException { try { slot.getPrivateMethodWrite() .invoke(obj, new Object[] {new ObjectOutputStreamProxy(out, obj, slot, substitution)}); } catch (IOException e) { throw e; } catch (Exception e) { e.printStackTrace(); IOException io = new IOException(e.getMessage()); io.initCause(e); throw io; } }
private static void readSlotWithMethod( ClassMetaDataSlot slot, short[] fieldsKey, ObjectInput input, Object obj, ObjectSubstitutionInterface substitution) throws IOException { try { slot.getPrivateMethodRead() .invoke( obj, new Object[] {new ObjectInputStreamProxy(input, fieldsKey, obj, slot, substitution)}); } catch (IOException e) { throw e; } catch (Exception e) { IOException io = new IOException(e.getMessage()); io.initCause(e); throw io; } }