code: private static void writeFlags(ObjectOutput out, Fieldable field) throws IOException
     {
        int flags = 0;
        if (field.isStored())
        {
           flags |= STORED_FLAG;
        }
        if (field.isIndexed())
        {
           flags |= INDEXED_FLAG;
        }
        if (field.isTokenized())
        {
           flags |= TOKENIZED_FLAG;
        }
        if (field.getOmitNorms())
        {
           flags |= OMIT_NORMS_FLAG;
        }
        if (field.isBinary())
        {
           flags |= BINARY_FLAG;
        }
        if (field.isTermVectorStored())
        {
           flags |= STORE_TERM_VECTOR_FLAG;
        }
        if (field.isStorePositionWithTermVector())
        {
           flags |= STORE_POSITION_WITH_TERM_VECTOR_FLAG;
        }
        if (field.isStoreOffsetWithTermVector())
        {
           flags |= STORE_OFFSET_WITH_TERM_VECTOR_FLAG;
        }
        if (field.isLazy())
        {
           flags |= LAZY_FLAG;
        }
        if (field instanceof AbstractField && ((AbstractField)field).getIndexOptions() == IndexOptions.DOCS_ONLY)
        {
           flags |= OMIT_TF_FLAG;
        }
        if (field.getBoost() != 1.0f)
        {
           flags |= BOOST_FLAG;
        }
        out.writeInt(flags);
     }
docs: Serialize the flags into the given {@link ObjectOutput}
  @param out the stream in which we serialize the flags
  @param field the field from which we extract the flags
  @throws IOException if the flags could not be serialized