oout.writeObject(e.getMessage());
ExternalizeUtil.writeCollection(oout, oout.getReferences());
oout.flush();
oout.close();
ChannelBuffer encoded = bout.buffer();
encoded.setInt(0, encoded.writerIndex() - 4);
write(ctx, e.getFuture(), encoded, e.getRemoteAddress());
for (InputStream is : oout.getStreams()) {
Channels.write(ctx.getChannel(), new AnonymousChunkedStream(new BufferedInputStream(is, CHUNK_SIZE)));
}