Read the security context

@param fields
@throws IOException if there are I/O errors while reading from the underlying InputStream
482644
private void readState(GetField fields) throws IOException {
        //get caller principal
        callerPrincipal = (WSPrincipal) fields.get(CALLER_PRINCIPAL, null);

        //get boolean marking if subjects are equal
        subjectsAreEqual = fields.get(SUBJECTS_ARE_EQUAL, false);

        //only deserialize invocation principal if it's different from the caller
        if (!subjectsAreEqual) {
            //get invocation principal
            invocationPrincipal = (WSPrincipal) fields.get(INVOCATION_PRINCIPAL, null);
        } else {
            invocationPrincipal = callerPrincipal;
        }

        jaasLoginContextEntry = (String) fields.get(JAAS_LOGIN_CONTEXT, null);
        callerSubjectCacheKey = (String) fields.get(CALLER_SUBJECT_CACHE_KEY, null);
        invocationSubjectCacheKey = (String) fields.get(INVOCATION_SUBJECT_CACHE_KEY, null);
    }
1097029
public ByteBuffer getValue(String field) throws IOException {
        int hash = Arrays.hashCode(field.getBytes());
        return getValue(structure.valueHash2Index.get(hash));
    }
1234526
public void setFields(java.util.Collection<Field> fields) {
        if (fields == null) {
            this.fields = null;
            return;
        }

        this.fields = new com.amazonaws.internal.SdkInternalList<Field>(fields);
    }
963757
String readField() throws IOException {
		int c;
		while (true) {
			c = reader.read();
			if (c == -1) {
				return "";
			} else if (!Character.isWhitespace(c)) {
				reader.unread(c);
				break;
			} else if (c == '\n') {
				reader.unread(c);
				return "";
			}
		}
		if (c == QUOTE_CHAR) {
			return readEscaped();
		} else {
			return readNonEscaped();
		}
	}
292980
def read
      @field_stream.read = @read

      field_count = FIELDS.length
      fields = @field_stream.each(
        self.class.delimiter, field_count, PS4_START_REGEXP
      )

      # +take(field_count)+ would be more natural here, but doesn't seem to
      # play nicely with +Enumerator+s backed by +IO+ objects.
      loop do
        break if (hit = (1..field_count).map { fields.next }).empty?

        parse_hit!(*hit)
      end

      @read.close unless @read.closed?

      @files
    end
63679
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
   {
      ObjectInputStream.GetField fields = ois.readFields();
      String name = serialPersistentFields[ID_IDX].getName();
      this.id = fields.get(name, CONNECTION_ERROR_OCCURRED);
      name = serialPersistentFields[EXCEPTION_IDX].getName();
      this.e = (Exception) fields.get(name, null);
      name = serialPersistentFields[CONN_HANDLE_IDX].getName();
      this.connectionHandle = fields.get(name, null);
   }
552119
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
		in.defaultReadObject();
		this.nullMask = new boolean[fieldSerializers.length];
	}
262797
public void readFields(DataInput in) throws IOException {
    int appIdLength = in.readInt();
    this.appId = new byte[appIdLength];
    in.readFully(appId);
    this.maxCount = in.readInt();
  }
289363
public void readFrom(File keyFile) throws IOException, GeneralSecurityException {
        final String password = isPemEncrypted(keyFile)
                ? askForPasswd(keyFile.getCanonicalPath())
                : null
        ;
        privateKeys.add(loadKey(keyFile, password));
    }
1177479
private void init(final SecurityContext securityContext, final Class type, final Field field, final String path) throws FrameworkException {

		final QueryConfig config = getConfig(path);

		config.handleTypeArguments(securityContext, type, field.getArguments());

		final SelectionSet selectionSet = field.getSelectionSet();
		if (selectionSet != null) {

			for (final Selection selection : selectionSet.getSelections()) {

				if (selection instanceof Field) {

					final Field childField      = (Field)selection;
					final SelectionSet childSet = childField.getSelectionSet();
					final PropertyKey key       = StructrApp.key(type, childField.getName());
					final Class relatedType     = key.relatedType() != null ? key.relatedType() : type;

					// add field to property set
					config.addPropertyKey(key);
					config.handleFieldArguments(securityContext, relatedType, field, childField);

					// recurse
					if (childSet != null) {

						init(securityContext, relatedType, childField, path + "/" + childField.getName());
					}
				}
			}
		}
	}
237105
@Trivial
    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
        GetField fields = in.readFields();
        failure = (Throwable) fields.get(FAILURE, null);
        previousResult = (byte[]) fields.get(PREVIOUS_RESULT, null);
    }
1114919
private void readObject(ObjectInputStream stream)
        throws IOException, ClassNotFoundException
    {
        stream.defaultReadObject();

        // set transient fields
        setOut( System.out );
        setErr( System.err );
    }
29804
private void read() throws IOException {
		// read specifications for standard fields and data directories
		Map<String, String[]> standardSpec = IOUtil.readMap(STANDARD_SPEC);

		// read magic number
		this.magicNumber = readMagicNumber(standardSpec);

		/* load fields */
		loadStandardFields();
		loadWindowsSpecificFields();
		loadDataDirectory();
	}
1195660
public InputStream extractRevision(String field) throws IOException {
        getSignatureNames();
        field = getTranslatedFieldName(field);
        if (!sigNames.containsKey(field))
            return null;
        int length = ((int[])sigNames.get(field))[0];
        RandomAccessFileOrArray raf = reader.getSafeFile();
        raf.reOpen();
        raf.seek(0);
        return new RevisionStream(raf, length);
    }
509448
public static PermissionStatus read(DataInput in) throws IOException {
    PermissionStatus p = new PermissionStatus();
    p.readFields(in);
    return p;
  }
554903
private void init() throws IOException {
    // move to begin
    IndexInput inField = indexInputList.get("field");
    inField.seek(indexInputOffsetList.get("field"));
    // store field references in memory
    fieldReferences = new HashMap<String, FieldReferences>();
    boolean doInit = true;
    while (doInit) {
      try {
        String field = inField.readString();
        long refIndexDoc = inField.readVLong();
        long refIndexDocId = inField.readVLong();
        int numberOfDocs = inField.readVInt();
        inField.readVLong(); // refTerm
        inField.readVInt(); // numberOfTerms
        long refPrefix = inField.readVLong();
        int numberOfPrefixes = inField.readVInt();
        fieldReferences.put(field, new FieldReferences(refIndexDoc,
            refIndexDocId, numberOfDocs, refPrefix, numberOfPrefixes));
      } catch (IOException e) {
        log.debug(e);
        doInit = false;
      }
    }
    // prefixReferences
    prefixReferences = new HashMap<String, LinkedHashMap<String, Long>>();
  }
438058
public static UserAgentParser parse(final Reader input, final Collection<BrowsCapField> fields)
            throws IOException, ParseException {
        return new UserAgentFileParser(fields).parse(input);
    }