org.bouncycastle.bcpg
Class ArmoredInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--org.bouncycastle.bcpg.ArmoredInputStream
- public class ArmoredInputStream
- extends java.io.InputStream
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 |
ArmoredInputStream(java.io.InputStream in)
Create a stream for reading a PGP armoured message, parsing up to a header
and then reading the data that follows. |
ArmoredInputStream(java.io.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. |
Methods inherited from class java.io.InputStream |
close, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ArmoredInputStream
public ArmoredInputStream(java.io.InputStream in)
throws java.io.IOException
- Create a stream for reading a PGP armoured message, parsing up to a header
and then reading the data that follows.
- Parameters:
in
-
ArmoredInputStream
public ArmoredInputStream(java.io.InputStream in,
boolean hasHeaders)
throws java.io.IOException
- 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.
available
public int available()
throws java.io.IOException
- Overrides:
available
in class java.io.InputStream
isClearText
public boolean isClearText()
- Returns:
- true if we are inside the clear text section of a PGP
signed message.
getArmorHeaderLine
public java.lang.String getArmorHeaderLine()
- Return the armor header line (if there is one)
- Returns:
- the armor header line, null if none present.
getArmorHeaders
public java.lang.String[] 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
public int read()
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream