Package org.bouncycastle.bcpg
Class ArmoredInputStream
java.lang.Object
java.io.InputStream
org.bouncycastle.bcpg.ArmoredInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
reader for Base64 armored objects - read the headers and then start returning
bytes when the data is reached. An IOException is thrown if the CRC check
fails.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a stream for reading a PGP armoured message, parsing up to a header and then reading the data that follows.ArmoredInputStream(InputStream in, boolean hasHeaders) Create an armoured input stream which will assume the data starts straight away, or parse for headers first depending on the value of hasHeaders. -
Method Summary
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
ArmoredInputStream
Create a stream for reading a PGP armoured message, parsing up to a header and then reading the data that follows.- Parameters:
in-- Throws:
IOException
-
ArmoredInputStream
Create an armoured input stream which will assume the data starts straight away, or parse for headers first depending on the value of hasHeaders.- Parameters:
in-hasHeaders- true if headers are to be looked for, false otherwise.- Throws:
IOException
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
isClearText
public boolean isClearText()- Returns:
- true if we are inside the clear text section of a PGP signed message.
-
isEndOfStream
public boolean isEndOfStream()- Returns:
- true if the stream is actually at end of file.
-
getArmorHeaderLine
Return the armor header line (if there is one)- Returns:
- the armor header line, null if none present.
-
getArmorHeaders
Return the armor headers (the lines after the armor header line),- Returns:
- an array of armor headers, null if there aren't any.
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-