|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.marc4j.MarcStreamReader
public class MarcStreamReader
An iterator over a collection of MARC records in ISO 2709 format.
Example usage:
InputStream input = new FileInputStream("file.mrc"); MarcReader reader = new MarcStreamReader(input); while (reader.hasNext()) { Record record = reader.next(); // Process record }
Check the org.marc4j.marc
package for examples about the use of
the Record
object model.
When no encoding is given as an constructor argument the parser tries to resolve the encoding by looking at the character coding scheme (leader position 9) in MARC21 records. For UNIMARC records this position is not defined.
Constructor Summary | |
---|---|
MarcStreamReader(InputStream input)
Constructs an instance with the specified input stream. |
|
MarcStreamReader(InputStream input,
String encoding)
Constructs an instance with the specified input stream. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if the iteration has more records, false otherwise. |
Record |
next()
Returns the next record in the iteration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MarcStreamReader(InputStream input)
public MarcStreamReader(InputStream input, String encoding)
Method Detail |
---|
public boolean hasNext()
hasNext
in interface MarcReader
public Record next()
next
in interface MarcReader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |