use of org.gradle.internal.serialize.ExceptionReplacingObjectOutputStream in project gradle by gradle.
the class InProcessWorkerFactory method transferResultFromWorkerClassLoader.
private DefaultWorkResult transferResultFromWorkerClassLoader(Object result) throws IOException, ClassNotFoundException {
ByteArrayOutputStream resultBytes = new ByteArrayOutputStream();
ObjectOutputStream oos = new ExceptionReplacingObjectOutputStream(resultBytes);
try {
oos.writeObject(result);
} finally {
oos.close();
}
ObjectInputStream ois = new ExceptionReplacingObjectInputStream(new ByteArrayInputStream(resultBytes.toByteArray()), getClass().getClassLoader());
return (DefaultWorkResult) ois.readObject();
}
Aggregations