src/main/java/com/aoindustries/io/buffer/SegmentedResult.java
private void append(int segmentIndex, StringBuilder buffer) {
		switch(segmentTypes[segmentIndex]) {
			case SegmentedWriter.TYPE_STRING :
				int off = segmentOffsets[segmentIndex];
				buffer.append(
					(String)segmentValues[segmentIndex],
					off,
					off + segmentLengths[segmentIndex]
				);
				break;
			case SegmentedWriter.TYPE_CHAR_NEWLINE :
				assert segmentOffsets[segmentIndex]==0;
				assert segmentLengths[segmentIndex]==1;
				buffer.append('\n');
				break;
			case SegmentedWriter.TYPE_CHAR_QUOTE :
				assert segmentOffsets[segmentIndex]==0;
				assert segmentLengths[segmentIndex]==1;
				buffer.append('"');
				break;
			case SegmentedWriter.TYPE_CHAR_APOS :
				assert segmentOffsets[segmentIndex]==0;
				assert segmentLengths[segmentIndex]==1;
				buffer.append('\'');
				break;
			case SegmentedWriter.TYPE_CHAR_OTHER :
				assert segmentOffsets[segmentIndex]==0;
				assert segmentLengths[segmentIndex]==1;
				buffer.append(((Character)segmentValues[segmentIndex]).charValue());
				break;
			default :
				throw new AssertionError();
		}
	}
private void append(int segmentIndex, StringBuilder buffer) {
		switch(segmentTypes[segmentIndex]) {
			case SegmentedWriter.TYPE_STRING :
				int off = segmentOffsets[segmentIndex];
				buffer.append(
					(String)segmentValues[segmentIndex],
					off,
					off + segmentLengths[segmentIndex]
				);
				break;
			case SegmentedWriter.TYPE_CHAR_NEWLINE :
				assert segmentOffsets[segmentIndex]==0;
				assert segmentLengths[segmentIndex]==1;
				buffer.append('\n');
				break;
			case SegmentedWriter.TYPE_CHAR_QUOTE :
				assert segmentOffsets[segmentIndex]==0;
				assert segmentLengths[segmentIndex]==1;
				buffer.append('"');
				break;
			case SegmentedWriter.TYPE_CHAR_APOS :
				assert segmentOffsets[segmentIndex]==0;
				assert segmentLengths[segmentIndex]==1;
				buffer.append('\'');
				break;
			case SegmentedWriter.TYPE_CHAR_OTHER :
				assert segmentOffsets[segmentIndex]==0;
				assert segmentLengths[segmentIndex]==1;
				buffer.append(((Character)segmentValues[segmentIndex]).charValue());
				break;
			default :
				throw new AssertionError();
		}
	}
Appends the full segment (with original offset and length) to the buffer.