Write field symbol, entering all references into constant pool.
182914
void writeField(VarSymbol v) {
        int flags = adjustFlags(v.flags());
        databuf.appendChar(flags);
        if (dumpFieldModifiers) {
            PrintWriter pw = log.getWriter(Log.WriterKind.ERROR);
            pw.println("FIELD  " + v.name);
            pw.println("---" + flagNames(v.flags()));
        }
        databuf.appendChar(pool.put(v.name));
        databuf.appendChar(pool.put(typeSig(v.erasure(types))));
        int acountIdx = beginAttrs();
        int acount = 0;
        if (v.getConstValue() != null) {
            int alenIdx = writeAttr(names.ConstantValue);
            databuf.appendChar(pool.put(v.getConstValue()));
            endAttr(alenIdx);
            acount++;
        }
        acount += writeMemberAttrs(v);
        endAttrs(acountIdx, acount);
    }
313531
def PrintField(self, field, value):
    """"""
    out = self.out
    out.write(' ' * self.indent)
    if self.use_field_number:
      out.write(str(field.number))
    else:
      if field.is_extension:
        out.write('[')
        if (field.containing_type.GetOptions().message_set_wire_format and
            field.type == descriptor.FieldDescriptor.TYPE_MESSAGE and
            field.label == descriptor.FieldDescriptor.LABEL_OPTIONAL):
          out.write(field.message_type.full_name)
        else:
          out.write(field.full_name)
        out.write(']')
      elif field.type == descriptor.FieldDescriptor.TYPE_GROUP:
        # For groups, use the capitalized name.
        out.write(field.message_type.name)
      else:
        out.write(field.name)

    if field.cpp_type != descriptor.FieldDescriptor.CPPTYPE_MESSAGE:
      # The colon is optional in this case, but our cross-language golden files
      # don't include it.
      out.write(': ')

    self.PrintFieldValue(field, value)
    if self.as_one_line:
      out.write(' ')
    else:
      out.write('\n')
1104711
@Override
    public void write(DataOutput out) throws IOException
    {
        addSignatureIfNeed();
        out.writeInt(magic);
        out.writeShort(minor_version);
        out.writeShort(major_version);
        out.writeShort(constant_pool.size()+1);
        for (ConstantInfo ci : constant_pool)
        {
            ci.write(out);
        }
        int modifier = ClassFlags.getModifier(getModifiers());
        modifier |= ClassFlags.ACC_SYNTHETIC | ClassFlags.ACC_PUBLIC | ClassFlags.ACC_SUPER;
        out.writeShort(modifier);
        out.writeShort(this_class);
        out.writeShort(super_class);
        out.writeShort(interfaces.size());
        for (int ii : interfaces)
        {
            out.writeShort(ii);
        }
        out.writeShort(fields.size());
        for (FieldInfo fi : fields)
        {
            fi.write(out);
        }
        out.writeShort(methods.size());
        for (MethodInfo mi : methods)
        {
            mi.write(out);
        }
        out.writeShort(attributes.size());
        for (AttributeInfo ai : attributes)
        {
            ai.write(out);
        }

    }
190091
private static void writeField(final OutputStream out, final int num) throws IOException {
    final byte[] bytes = BigInteger.valueOf(num).toByteArray();
    writeField(out, bytes);
  }
355762
private void writeFieldBegin(OutputStream result) throws IOException 
    {
        result.write(OPEN_GROUP);
        result.write(FIELD);
        if(fieldDirty) result.write(FIELD_DIRTY);
        if(fieldEdit) result.write(FIELD_EDIT);
        if(fieldLocked) result.write(FIELD_LOCKED);
        if(fieldPrivate) result.write(FIELD_PRIVATE);
    }
257846
void putFieldInfo(final ByteVector output) {
    boolean useSyntheticAttribute = symbolTable.getMajorVersion() < Opcodes.V1_5;
    // Put the access_flags, name_index and descriptor_index fields.
    int mask = useSyntheticAttribute ? Opcodes.ACC_SYNTHETIC : 0;
    output.putShort(accessFlags & ~mask).putShort(nameIndex).putShort(descriptorIndex);
    // Compute and put the attributes_count field.
    // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
    int attributesCount = 0;
    if (constantValueIndex != 0) {
      ++attributesCount;
    }
    if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0 && useSyntheticAttribute) {
      ++attributesCount;
    }
    if (signatureIndex != 0) {
      ++attributesCount;
    }
    if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {
      ++attributesCount;
    }
    if (firstAttribute != null) {
      attributesCount += firstAttribute.getAttributeCount();
    }
    output.putShort(attributesCount);
    // Put the field_info attributes.
    // For ease of reference, we use here the same attribute order as in Section 4.7 of the JVMS.
    if (constantValueIndex != 0) {
      output
          .putShort(symbolTable.addConstantUtf8(Constants.CONSTANT_VALUE))
          .putInt(2)
          .putShort(constantValueIndex);
    }
    if ((accessFlags & Opcodes.ACC_SYNTHETIC) != 0 && useSyntheticAttribute) {
      output.putShort(symbolTable.addConstantUtf8(Constants.SYNTHETIC)).putInt(0);
    }
    if (signatureIndex != 0) {
      output
          .putShort(symbolTable.addConstantUtf8(Constants.SIGNATURE))
          .putInt(2)
          .putShort(signatureIndex);
    }
    if ((accessFlags & Opcodes.ACC_DEPRECATED) != 0) {
      output.putShort(symbolTable.addConstantUtf8(Constants.DEPRECATED)).putInt(0);
    }
    if (firstAttribute != null) {
      firstAttribute.putAttributes(symbolTable, output);
    }
  }
272830
private void writeCustomFields() throws IOException
   {
      m_writer.writeStartList("custom_fields");
      for (CustomField field : m_projectFile.getCustomFields())
      {
         writeCustomField(field);
      }
      m_writer.writeEndList();
   }
820221
private void writeSymbolsField(SymbolTable symTab)
    {
        // SymbolTable's APIs doesn't expose an Iterator to traverse declared
        // symbol strings in reverse order. As such, we utilize these two
        // indexes to traverse the strings in reverse.
        int importedMaxId = symTab.getImportedMaxId();
        int maxId = symTab.getMaxId();

        if (importedMaxId == maxId) {
            // There are no declared local symbols
            return;
        }

        final int originalOffset = myBuffer.length - myOffset;

        for (int i = maxId; i > importedMaxId; i--)
        {
            String str = symTab.findKnownSymbol(i);
            if (str == null) {
                writeByte((byte) (TYPE_STRING | NULL_LENGTH_MASK));
            } else {
                writeIonStringContent(str);
            }
        }

        writePrefix(TYPE_LIST, myBuffer.length - myOffset - originalOffset);
        writeByte((byte) (0x80 | SYMBOLS_SID));
    }
303852
void write(ByteCodeWriter out)
    throws IOException
  {
    out.write(ConstantPool.CP_UTF8);
    out.writeUTF8(_value);
  }
1311999
private void writeAllBufferedData()
        throws IOException
    {
        writeBytes(_user_output_stream);

        clearFieldName();
        clearAnnotations();

        _in_struct = false;
        _patch_count = 0;
        _patch_symbol_table_count = 0;
        _top = 0;
        try {
            _writer.setPosition(0);
            _writer.truncate();
        }
        catch (IOException e) {
            throw new IonException(e);
        }
    }
1321382
private void writeObject(final java.io.ObjectOutputStream out)
     throws IOException {
     out.writeObject(field);
     out.writeObject(pattern.pattern());
   }
1222896
private void writeObject(java.io.ObjectOutputStream s)
        throws java.io.IOException {

        java.io.ObjectOutputStream.PutField fields = s.putFields();
        fields.put("rnd", U.getLong(Thread.currentThread(), SEED));
        fields.put("initialized", true);
        s.writeFields();
    }
176248
def write(self):
        

        none_type = type(None)

        # Format attributes for writing
        attrs = self.attribute_string()

        # Place holder if field value is NoneType
        for attr in self.__dict__.keys():
            if type(attr) == none_type:
                setattr(self, attr, '.')

        # Format entry for writing
        fstr = '{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}{9}'\
               .format(self.seqid, self.source, self.type, str(self.start),
                       str(self.end), self._score_str, self.strand, 
                       self.phase, attrs, os.linesep)

        return fstr
368255
private void writeObjectToField(String fieldname, Object value, Object object, Object alternative)
        throws Exception {
        Object target = object != null ? object : alternative;
        try {
            FieldUtils.writeField(target, fieldname, value, true);
        } catch (Exception e) {
            throw new IllegalArgumentException(String.format("Unable to write value '%s' to field '%s' of object %s",
                value.toString(), fieldname, target.getClass().getName()));
        }
    }
319989
public void writeField(String field) throws IOException {

		if (this.newLine) {
			this.newLine = false;
		} else {
			this.write(',');
		}

		// case 0: empty string, simple :)
		if ((field == null) || (field.length() == 0)) {
			return;
		}

		// case 1: field has quotes in it, if so convert to, quote field and
		// double all quotes
		Matcher matcher = escapePattern.matcher(field);
		if (matcher.find()) {
			this.write('"');
			this.tmpBuffer.setLength(0);
			do {
				matcher.appendReplacement(this.tmpBuffer, "\"\"");
			} while (matcher.find());
			matcher.appendTail(this.tmpBuffer);
			this.write(this.tmpBuffer.toString());
			this.write('"');
			return;
		}

		// case 2: field has a comma, carriage return or new line in it, if so
		// quote field and double all quotes
		matcher = specialCharsPattern.matcher(field);
		if (matcher.find()) {
			this.write('"');
			this.write(field);
			this.write('"');
			return;
		}

		// case 3: safe string to just add
		this.append(field);
	}
741276
public void write(Writer writer)
        throws IOException
    {
        synchronized(writer)
        {
            for (int i=0;i<_fields.size();i++)
            {
                Field field=(Field)_fields.get(i);
                if (field!=null)
                    field.write(writer,_version);
            }
            writer.write(__CRLF);
        }
    }
76026
public void addConstant(ConstantField field) {
        constantList.add(field);
        constants.put(field.name, field);
    }