From bfa3409fc5a7225471ed49e8067a40db42c41cf3 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Tue, 19 Jan 2010 12:02:10 +0000 Subject: [PATCH] Add more documentation, and make the constructor public for testing use git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@900744 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hssf/record/cont/ContinuableRecordOutput.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java b/src/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java index 26946c7cc..0f85139a3 100644 --- a/src/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java +++ b/src/java/org/apache/poi/hssf/record/cont/ContinuableRecordOutput.java @@ -35,7 +35,7 @@ public final class ContinuableRecordOutput implements LittleEndianOutput { private UnknownLengthRecordOutput _ulrOutput; private int _totalPreviousRecordsSize; - ContinuableRecordOutput(LittleEndianOutput out, int sid) { + public ContinuableRecordOutput(LittleEndianOutput out, int sid) { _ulrOutput = new UnknownLengthRecordOutput(out, sid); _out = out; _totalPreviousRecordsSize = 0; @@ -73,6 +73,11 @@ public final class ContinuableRecordOutput implements LittleEndianOutput { _totalPreviousRecordsSize += _ulrOutput.getTotalSize(); _ulrOutput = new UnknownLengthRecordOutput(_out, ContinueRecord.sid); } + /** + * Will terminate the current record and start a new {@link ContinueRecord} + * if there isn't space for the requested number of bytes + * @param requiredContinuousSize The number of bytes that need to be written + */ public void writeContinueIfRequired(int requiredContinuousSize) { if (_ulrOutput.getAvailableSpace() < requiredContinuousSize) { writeContinue();