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

Constructor Index

 o BufferedBerStream(InputStream)
Create a BufferedInputStream ready for reading BerStrings.

Method Index

 o readBerString()
Read a BerString from the InputStream.

Constructors

 o BufferedBerStream
  public BufferedBerStream(InputStream in) throws FileNotFoundException
Create a BufferedInputStream ready for reading BerStrings.
Parameters:
in - InputStream
Throws: FileNotFoundException
Creation of BufferedInputStream failed

Methods

 o 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