messageWriter = new OutputStreamWriter(messageBuffer, "utf-8");
JsonWriter jsonWriter = new JsonWriter(messageWriter);
jsonWriter.write(log);
messageWriter.write("\n");
} catch (IOException e) {
throw new InternalSpockError(e);
} finally {
IoUtil.closeQuietly(messageWriter);
}
ByteArrayOutputStream sizeBuffer = new ByteArrayOutputStream();
Writer sizeWriter = null;
try {
sizeWriter = new OutputStreamWriter(sizeBuffer, "utf-8");
sizeWriter.write(String.valueOf(messageBuffer.size()));
sizeWriter.write("\n");
} catch (IOException e) {
throw new InternalSpockError(e);
} finally {
IoUtil.closeQuietly(sizeWriter);
}
try {