ORG.oclc.ber
Class 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;
}
}
- See Also:
BerString
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
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
BufferedBerStream
public BufferedBerStream(InputStream in)
- Create a BufferedInputStream ready for reading BerStrings. The default
buffer size is 10000 bytes.
- Parameters:
in
- InputStream
BufferedBerStream
public BufferedBerStream(InputStream in,
int size)
- Create a BufferedInputStream ready for reading BerStrings.
- Parameters:
in
- InputStreamint
- buffer size
BufferedBerStream
public BufferedBerStream(String filename,
int size)
throws FileNotFoundException
- Create a BufferedInputStream ready for reading BerStrings.
- Parameters:
in
- filenameint
- buffer size- 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.
- EOFException - End of file was reached.
- IOException - I/O Error occured while reading file.