Code example for PushbackInputStream

Methods: read, unread

0
                    sDataObjectCount = 0;
                    return null; 
                } 
            } 
 
            PushbackInputStream pis = new PushbackInputStream(in);
            int tag = pis.read();
 
            if (tag == -1)
            { 
                return null; 
            } 
 
            pis.unread(tag);
 
            if (tag != 0x30)  // assume ascii PEM encoded.
            { 
                return readPEMCertificate(pis);
            } 
            else 
            { 
                return readDERCertificate(new ASN1InputStream(pis));
            } 
        } 
        catch (Exception e)
        { 
            throw new ExCertificateException(e);