de.intarsys.tools.reader
Class TaggedReader
java.lang.Object
java.io.Reader
de.intarsys.tools.reader.TaggedReader
- All Implemented Interfaces:
- Closeable, Readable
public class TaggedReader
- extends Reader
This reader extracts meta information from the data header.
The syntax for an entry is
'$$$' ws* key ws* '=' value '\n'
value = string | quoted_string
quoted_string = '"' [ char | escape ]* '"'
Meta data is scanned until the first line not starting with '$$$'. So the
first character returned is the first character on the first line not
starting with '$$$'.
TaggedReader
public TaggedReader(Reader reader,
int size)
throws IOException
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close in interface Closeable- Specified by:
close in class Reader
- Throws:
IOException
getEncoding
public String getEncoding()
getProperty
public String getProperty(String name)
getPropertyNames
public Iterator<String> getPropertyNames()
mark
public void mark(int readAheadLimit)
throws IOException
- Overrides:
mark in class Reader
- Throws:
IOException
markSupported
public boolean markSupported()
- Overrides:
markSupported in class Reader
putProperty
public void putProperty(String name,
String value)
read
public int read()
throws IOException
- Overrides:
read in class Reader
- Throws:
IOException
read
public int read(char[] cbuf,
int off,
int len)
throws IOException
- Specified by:
read in class Reader
- Throws:
IOException
ready
public boolean ready()
throws IOException
- Overrides:
ready in class Reader
- Throws:
IOException
reset
public void reset()
throws IOException
- Overrides:
reset in class Reader
- Throws:
IOException
skip
public long skip(long n)
throws IOException
- Overrides:
skip in class Reader
- Throws:
IOException
Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.