super(historyId, serialized);
}
- public static PurgeLocalHistoryPayload create(final LocalHistoryIdentifier historyId) {
- final ByteArrayDataOutput out = ByteStreams.newDataOutput();
+ public static PurgeLocalHistoryPayload create(final LocalHistoryIdentifier historyId,
+ final int initialSerializedBufferCapacity) {
+ final ByteArrayDataOutput out = ByteStreams.newDataOutput(initialSerializedBufferCapacity);
try {
historyId.writeTo(out);
} catch (IOException e) {
// This should never happen
LOG.error("Failed to serialize {}", historyId, e);
- throw new RuntimeException("Failed to serialize " + historyId, e);
+ throw new IllegalStateException("Failed to serialize " + historyId, e);
}
return new PurgeLocalHistoryPayload(historyId, out.toByteArray());
}