1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
\r
5 <!-- Generated by javadoc (build 1.5.0_06) on Fri Oct 17 16:04:52 EDT 2008 -->
\r
7 MarcStreamReader (MARC4J API)
\r
10 <META NAME="keywords" CONTENT="org.marc4j.MarcStreamReader class">
\r
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
\r
14 <SCRIPT type="text/javascript">
\r
15 function windowTitle()
\r
17 parent.document.title="MarcStreamReader (MARC4J API)";
\r
25 <BODY BGCOLOR="white" onload="windowTitle();">
\r
28 <!-- ========= START OF TOP NAVBAR ======= -->
\r
29 <A NAME="navbar_top"><!-- --></A>
\r
30 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
\r
31 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
\r
33 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
\r
34 <A NAME="navbar_top_firstrow"><!-- --></A>
\r
35 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
\r
36 <TR ALIGN="center" VALIGN="top">
\r
37 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
\r
38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
\r
39 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
\r
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MarcStreamReader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
\r
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
\r
42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
\r
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
\r
44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
\r
48 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
\r
54 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
55 <A HREF="../../org/marc4j/MarcReader.html" title="interface in org.marc4j"><B>PREV CLASS</B></A>
\r
56 <A HREF="../../org/marc4j/MarcStreamWriter.html" title="class in org.marc4j"><B>NEXT CLASS</B></A></FONT></TD>
\r
57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
58 <A HREF="../../index.html?org/marc4j/MarcStreamReader.html" target="_top"><B>FRAMES</B></A>
\r
59 <A HREF="MarcStreamReader.html" target="_top"><B>NO FRAMES</B></A>
\r
60 <SCRIPT type="text/javascript">
\r
63 document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
\r
68 <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
\r
75 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
76 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
\r
77 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
78 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
\r
81 <A NAME="skip-navbar_top"></A>
\r
82 <!-- ========= END OF TOP NAVBAR ========= -->
\r
85 <!-- ======== START OF CLASS DATA ======== -->
\r
90 Class MarcStreamReader</H2>
\r
92 <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A>
\r
93 <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>org.marc4j.MarcStreamReader</B>
\r
96 <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../org/marc4j/MarcReader.html" title="interface in org.marc4j">MarcReader</A></DD>
\r
100 <DT><PRE>public class <B>MarcStreamReader</B><DT>extends <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A><DT>implements <A HREF="../../org/marc4j/MarcReader.html" title="interface in org.marc4j">MarcReader</A></DL>
\r
104 An iterator over a collection of MARC records in ISO 2709 format.
109 InputStream input = new FileInputStream("file.mrc");
110 MarcReader reader = new MarcStreamReader(input);
111 while (reader.hasNext()) {
112 Record record = reader.next();
118 Check the <A HREF="../../org/marc4j/marc/package-summary.html"><CODE>org.marc4j.marc</CODE></A> package for examples about the use of
119 the <A HREF="../../org/marc4j/marc/Record.html" title="interface in org.marc4j.marc"><CODE>Record</CODE></A> object model.
123 When no encoding is given as an constructor argument the parser tries to
124 resolve the encoding by looking at the character coding scheme (leader
125 position 9) in MARC21 records. For UNIMARC records this position is not
132 <DT><B>Version:</B></DT>
\r
133 <DD>$Revision: 1.11 $</DD>
\r
134 <DT><B>Author:</B></DT>
\r
135 <DD>Bas Peters</DD>
\r
141 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
\r
143 <A NAME="constructor_summary"><!-- --></A>
\r
144 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
145 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
146 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
\r
147 <B>Constructor Summary</B></FONT></TH>
\r
149 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
150 <TD><CODE><B><A HREF="../../org/marc4j/MarcStreamReader.html#MarcStreamReader(java.io.InputStream)">MarcStreamReader</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> input)</CODE>
\r
153 Constructs an instance with the specified input stream.</TD>
\r
155 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
156 <TD><CODE><B><A HREF="../../org/marc4j/MarcStreamReader.html#MarcStreamReader(java.io.InputStream, java.lang.String)">MarcStreamReader</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> input,
\r
157 <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> encoding)</CODE>
\r
160 Constructs an instance with the specified input stream.</TD>
\r
164 <!-- ========== METHOD SUMMARY =========== -->
\r
166 <A NAME="method_summary"><!-- --></A>
\r
167 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
168 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
169 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
\r
170 <B>Method Summary</B></FONT></TH>
\r
172 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
173 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
174 <CODE> boolean</CODE></FONT></TD>
\r
175 <TD><CODE><B><A HREF="../../org/marc4j/MarcStreamReader.html#hasNext()">hasNext</A></B>()</CODE>
\r
178 Returns true if the iteration has more records, false otherwise.</TD>
\r
180 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
181 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
\r
182 <CODE> <A HREF="../../org/marc4j/marc/Record.html" title="interface in org.marc4j.marc">Record</A></CODE></FONT></TD>
\r
183 <TD><CODE><B><A HREF="../../org/marc4j/MarcStreamReader.html#next()">next</A></B>()</CODE>
\r
186 Returns the next record in the iteration.</TD>
\r
189 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
\r
190 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
191 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
\r
192 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH>
\r
194 <TR BGCOLOR="white" CLASS="TableRowColor">
\r
195 <TD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
\r
201 <!-- ========= CONSTRUCTOR DETAIL ======== -->
\r
203 <A NAME="constructor_detail"><!-- --></A>
\r
204 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
205 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
206 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
\r
207 <B>Constructor Detail</B></FONT></TH>
\r
211 <A NAME="MarcStreamReader(java.io.InputStream)"><!-- --></A><H3>
\r
212 MarcStreamReader</H3>
\r
214 public <B>MarcStreamReader</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> input)</PRE>
\r
216 <DD>Constructs an instance with the specified input stream.
\r
221 <A NAME="MarcStreamReader(java.io.InputStream, java.lang.String)"><!-- --></A><H3>
\r
222 MarcStreamReader</H3>
\r
224 public <B>MarcStreamReader</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> input,
\r
225 <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> encoding)</PRE>
\r
227 <DD>Constructs an instance with the specified input stream.
\r
231 <!-- ============ METHOD DETAIL ========== -->
\r
233 <A NAME="method_detail"><!-- --></A>
\r
234 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
\r
235 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
\r
236 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
\r
237 <B>Method Detail</B></FONT></TH>
\r
241 <A NAME="hasNext()"><!-- --></A><H3>
\r
244 public boolean <B>hasNext</B>()</PRE>
\r
246 <DD>Returns true if the iteration has more records, false otherwise.
\r
249 <DT><B>Specified by:</B><DD><CODE><A HREF="../../org/marc4j/MarcReader.html#hasNext()">hasNext</A></CODE> in interface <CODE><A HREF="../../org/marc4j/MarcReader.html" title="interface in org.marc4j">MarcReader</A></CODE></DL>
\r
257 <A NAME="next()"><!-- --></A><H3>
\r
260 public <A HREF="../../org/marc4j/marc/Record.html" title="interface in org.marc4j.marc">Record</A> <B>next</B>()</PRE>
\r
262 <DD>Returns the next record in the iteration.
\r
265 <DT><B>Specified by:</B><DD><CODE><A HREF="../../org/marc4j/MarcReader.html#next()">next</A></CODE> in interface <CODE><A HREF="../../org/marc4j/MarcReader.html" title="interface in org.marc4j">MarcReader</A></CODE></DL>
\r
269 <DT><B>Returns:</B><DD>Record - the record object</DL>
\r
272 <!-- ========= END OF CLASS DATA ========= -->
\r
276 <!-- ======= START OF BOTTOM NAVBAR ====== -->
\r
277 <A NAME="navbar_bottom"><!-- --></A>
\r
278 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
\r
279 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
\r
281 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
\r
282 <A NAME="navbar_bottom_firstrow"><!-- --></A>
\r
283 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
\r
284 <TR ALIGN="center" VALIGN="top">
\r
285 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
\r
286 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
\r
287 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
\r
288 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MarcStreamReader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
\r
289 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
\r
290 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
\r
291 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
\r
292 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
\r
296 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
\r
302 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
303 <A HREF="../../org/marc4j/MarcReader.html" title="interface in org.marc4j"><B>PREV CLASS</B></A>
\r
304 <A HREF="../../org/marc4j/MarcStreamWriter.html" title="class in org.marc4j"><B>NEXT CLASS</B></A></FONT></TD>
\r
305 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
\r
306 <A HREF="../../index.html?org/marc4j/MarcStreamReader.html" target="_top"><B>FRAMES</B></A>
\r
307 <A HREF="MarcStreamReader.html" target="_top"><B>NO FRAMES</B></A>
\r
308 <SCRIPT type="text/javascript">
\r
311 document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
\r
316 <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
\r
323 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
324 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
\r
325 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
\r
326 DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
\r
329 <A NAME="skip-navbar_bottom"></A>
\r
330 <!-- ======== END OF BOTTOM NAVBAR ======= -->
\r
333 Copyright © 2002-2006 Bas Peters. All Rights Reserved.
\r