Class oclc.ber.BufferedBerStream
All Packages Class Hierarchy This Package Previous Next Index
Class oclc.ber.BufferedBerStream
java.lang.Object
|
+----oclc.ber.BufferedBerStream
- public class BufferedBerStream
- extends Object
BufferedBerStream is a class to sequentially read BER records from an
InputStream. Here is an example that opens a file, reads all the
records and prints each record.
BufferedBerStream berStream = null;
BerString berRec;
//
try { berStream = new BufferedBerStream(new FileInputStream("berfile")); }
catch (FileNotFoundException n) {
System.out.println(n.toString());
return;
}
//
while (true) {
try { berRec = berStream.readBerString();
System.out.println(berRec.toString());
}
catch (FileNotFoundException n) {
System.out.println(n.toString());
return;
} catch (EOFException n) {
System.out.println(n.toString());
return;
} catch (IOException n) {
System.out.println(n.toString());
return;
}
}
- Version:
- @(#)BufferedBerStream.java 1.2 06/27/96
- Author:
- Jenny Colvard
- See Also:
- BerString
-
BufferedBerStream(InputStream)
- Create a BufferedInputStream ready for reading BerStrings.
-
readBerString()
- Read a BerString from the InputStream.
BufferedBerStream
public BufferedBerStream(InputStream in) throws FileNotFoundException
- Create a BufferedInputStream ready for reading BerStrings.
- Parameters:
- in - InputStream
- Throws: FileNotFoundException
- Creation of BufferedInputStream failed
readBerString
public BerString readBerString() throws FileNotFoundException, EOFException, IOException
- Read a BerString from the InputStream.
- Throws: FileNotFoundException
- Creation of BufferedInputStream failed.
- Throws: EOFException
- End of file was reached.
- Throws: IOException
- I/O Error occured while reading file.
All Packages Class Hierarchy This Package Previous Next Index