Top Description Fields Constructors Methods
net.fortuna.ical4j.data

public Class FoldingWriter

extends FilterWriter
Class Inheritance
Imports
org.slf4j.Logger, .LoggerFactory, java.io.FilterWriter, .IOException, .Writer

$Id$ [Apr 6, 2004]

A writer that performs iCalendar folding as it writes.

Author
Ben Fortuna

Field Summary

Modifier and TypeField and Description
private static final char[]
private final int
private int
private final Logger
public static final int
MAX_FOLD_LENGTH

Lines of text SHOULD NOT be longer than 75 octets, excluding the line break.

public static final int
REDUCED_FOLD_LENGTH

reduced to 73 to be consistent with Apple iCal..

Inherited from java.io.FilterWriter:
out

Constructor Summary

AccessConstructor and Description
public
FoldingWriter(final Writer
a writer to write output to
writer
,
final int
the maximum line length
foldLength
)

public
FoldingWriter(final Writer
a writer to write output to
writer
)

Method Summary

Modifier and TypeMethod and Description
public final void
write(final int
int specifying a character to be written
c
)

Overrides java.io.FilterWriter.write.

Writes a single character.

public final void
write(final char[]
Buffer of characters to be written
buffer
,
final int
Offset from which to start reading characters
offset
,
final int
Number of characters to be written
length
)

Overrides java.io.FilterWriter.write.

Writes a portion of an array of characters.

public final void
write(final String
String to be written
str
,
final int
Offset from which to start reading characters
off
,
final int
Number of characters to be written
len
)

Overrides java.io.FilterWriter.write.

Writes a portion of a string.

Inherited from java.io.FilterWriter:
closeflush

Field Detail

FOLD_PATTERNback to summary
private static final char[] FOLD_PATTERN
foldLengthback to summary
private final int foldLength
lineLengthback to summary
private int lineLength
logback to summary
private final Logger log
MAX_FOLD_LENGTHback to summary
public static final int MAX_FOLD_LENGTH

Lines of text SHOULD NOT be longer than 75 octets, excluding the line break.

REDUCED_FOLD_LENGTHback to summary
public static final int REDUCED_FOLD_LENGTH

reduced to 73 to be consistent with Apple iCal..

Constructor Detail

FoldingWriterback to summary
public FoldingWriter(final Writer writer, final int foldLength)
Parameters
writer:Writer

a writer to write output to

foldLength:int

the maximum line length

FoldingWriterback to summary
public FoldingWriter(final Writer writer)
Parameters
writer:Writer

a writer to write output to

Method Detail

writeback to summary
public final void write(final int c) throws IOException

Overrides java.io.FilterWriter.write.

Doc from java.io.FilterWriter.write.

Writes a single character.

Parameters
c:int

Doc from java.io.Writer.write.

int specifying a character to be written

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
writeback to summary
public final void write(final char[] buffer, final int offset, final int length) throws IOException

Overrides java.io.FilterWriter.write.

Doc from java.io.FilterWriter.write.

Writes a portion of an array of characters.

Parameters
buffer:char[]

Buffer of characters to be written

offset:int

Offset from which to start reading characters

length:int

Number of characters to be written

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
writeback to summary
public final void write(final String str, final int off, final int len) throws IOException

Overrides java.io.FilterWriter.write.

Doc from java.io.FilterWriter.write.

Writes a portion of a string.

Parameters
str:String

String to be written

off:int

Offset from which to start reading characters

len:int

Number of characters to be written

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs