
ee.sk.digidoc.factory.SignatureInputStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdigidoc Show documentation
Show all versions of jdigidoc Show documentation
A Java libray for manipulating Estonian digital signature container files DDOC and BDOC. Note that this library is deprecated. It is recommended to use the new DigiDoc4j library at https://github.com/open-eid/digidoc4j
package ee.sk.digidoc.factory;
import java.io.FilterInputStream;
import java.io.InputStream;
import java.io.IOException;
/**
* Special input stream used to filter out BOM
* (byte-order-marks) from the beginning of xml signature
* or signed doc xml file.
* @author Veiko Sinivee
*/
public class SignatureInputStream
extends FilterInputStream
{
boolean bXml;
/**
* Constructor for SignatureInputStream
* @param in real input stream to be filtered
*/
public SignatureInputStream(InputStream in)
{
super(in);
bXml = false;
}
public int read() throws IOException
{
int b = super.read();
if(!bXml) {
while(b != '<' && b != -1)
b = super.read();
bXml = true;
}
return b;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy