All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ORG.oclc.ber.BufferedBerStream

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----java.io.FilterInputStream
                   |
                   +----java.io.BufferedInputStream
                           |
                           +----ORG.oclc.ber.BufferedBerStream

public class BufferedBerStream
extends BufferedInputStream
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.1 07/09/97
See Also:
BerString

Constructor Index

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

Method Index

 o readBerString()
Read a BerString from the InputStream.

Constructors

 o BufferedBerStream
 public BufferedBerStream(String filename) throws FileNotFoundException
Create a BufferedInputStream ready for reading BerStrings. The default buffer size is 10000 bytes.

Parameters:
in - filename
Throws: FileNotFoundException
Creation of BufferedInputStream failed
 o BufferedBerStream
 public BufferedBerStream(InputStream in)
Create a BufferedInputStream ready for reading BerStrings. The default buffer size is 10000 bytes.

Parameters:
in - InputStream
 o BufferedBerStream
 public BufferedBerStream(InputStream in,
                          int size)
Create a BufferedInputStream ready for reading BerStrings.

Parameters:
in - InputStream
int - buffer size
 o BufferedBerStream
 public BufferedBerStream(String filename,
                          int size) throws FileNotFoundException
Create a BufferedInputStream ready for reading BerStrings.

Parameters:
in - filename
int - buffer size
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