Package net.fortuna.ical4j.data
Class UnfoldingReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.FilterReader
-
- java.io.PushbackReader
-
- net.fortuna.ical4j.data.UnfoldingReader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
public class UnfoldingReader extends PushbackReader
$Id$ [06-Apr-2004]
A reader which performs iCalendar unfolding as it reads. Note that unfolding rules may be "relaxed" to allow unfolding of non-conformant *.ics files. By specifying the system property "ical4j.unfolding.relaxed=true" iCalendar files created with Mozilla Calendar/Sunbird may be correctly unfolded. To wrap this reader with aBufferedReader
you must ensure you specify an identical buffer size to that used in theBufferedReader
.
-
-
Field Summary
-
Fields inherited from class java.io.FilterReader
in
-
-
Constructor Summary
Constructors Constructor Description UnfoldingReader(Reader in)
Creates a new unfolding reader instance.UnfoldingReader(Reader in, boolean relaxed)
UnfoldingReader(Reader in, int size)
UnfoldingReader(Reader in, int size, boolean relaxed)
Creates a new unfolding reader instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLinesUnfolded()
int
read()
int
read(char[] cbuf, int off, int len)
-
Methods inherited from class java.io.PushbackReader
close, mark, markSupported, ready, reset, skip, unread, unread, unread
-
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
-
-
-
Constructor Detail
-
UnfoldingReader
public UnfoldingReader(Reader in)
Creates a new unfolding reader instance. Relaxed unfolding flag is read from system property.- Parameters:
in
- the reader to unfold from
-
UnfoldingReader
public UnfoldingReader(Reader in, int size)
- Parameters:
in
- reader source for datasize
- the buffer size
-
UnfoldingReader
public UnfoldingReader(Reader in, boolean relaxed)
- Parameters:
in
- reader source for datarelaxed
- indicates whether relaxed unfolding is enabled
-
UnfoldingReader
public UnfoldingReader(Reader in, int size, boolean relaxed)
Creates a new unfolding reader instance.- Parameters:
in
- a reader to read fromsize
- the buffer sizerelaxed
- specifies whether unfolding is relaxed
-
-
Method Detail
-
getLinesUnfolded
public final int getLinesUnfolded()
- Returns:
- number of lines unfolded so far while reading
-
read
public final int read() throws IOException
- Overrides:
read
in classPushbackReader
- Throws:
IOException
-
read
public int read(char[] cbuf, int off, int len) throws IOException
- Overrides:
read
in classPushbackReader
- Throws:
IOException
-
-