question: public static boolean isPEM ( InputStream is ) { try { String startPEM = "-----BEGIN" ; int headerLength = 100 ; byte [ ] preamble = new byte [ headerLength ] ; if ( is . read ( preamble , 0 , headerLength ) > 0 ) { String startArray = new String ( preamble ) ; return startArray . startsWith ( startPEM ) ; } return false ; } catch ( Exception e ) { throw new DSSException ( "Unable to read InputStream" ) ; } }
target:  This method returns true if the inputStream contains a PEM encoded item