code: 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);
      }
docs: Private helper routine to read an encoded string from the input
  stream.
  @param stringTag the tag for the type of string to read
  @param stringName a name to display in error messages
  @param enc the encoder to use to interpret the data. Should
  correspond to the stringTag above.