private String readString ( byte stringTag , String stringName , String enc ) throws IOException { if ( buffer . read ( ) != stringTag ) throw new IOException ( "DER input not a " + stringName + " string" ) ; int length = getLength ( buffer ) ; byte [ ] retval = new byte [ length ] ; if ( ( length != 0 ) && ( buffer . read ( retval ) != length ) ) throw new IOException ( "short read of DER " + stringName + " string" ) ; return new String ( retval , enc ) ; }
Private helper routine to read an encoded string from the input stream .