Writes the dbf header and field descriptors.
334085
def __dbfHeader(self):
        """"""
        f = self.__getFileObj(self.dbf)
        f.seek(0)
        version = 3
        year, month, day = time.localtime()[:3]
        year -= 1900
        # Remove deletion flag placeholder from fields
        for field in self.fields:
            if field[0].startswith("Deletion"):
                self.fields.remove(field)
        numRecs = len(self.records)
        numFields = len(self.fields)
        headerLength = numFields * 32 + 33
        recordLength = sum([int(field[2]) for field in self.fields]) + 1
        header = pack('<BBBBLHH20x', version, year, month, day, numRecs,
                headerLength, recordLength)
        f.write(header)
        # Field descriptors
        for field in self.fields:
            name, fieldType, size, decimal = field
            name = b(name)
            name = name.replace(b(' '), b('_'))
            name = name.ljust(11).replace(b(' '), b('\x00'))
            fieldType = b(fieldType)
            size = int(size)
            fld = pack('<11sc4xBB14x', name, fieldType, size, decimal)
            f.write(fld)
        # Terminator
        f.write(b('\r'))
345957
public void write(Output dest) throws IOException {
        int i, max;

        dest.writeU2(Access.toFlags(accessFlags));
        dest.writeClassRef(thisClass);
        if (superClass != null) {
            dest.writeClassRef(superClass);
        } else {
            dest.writeU2(0);
        }

        max = interfaces.size();
        dest.writeU2(max);
        for (i = 0; i < max; i++) {
            dest.writeClassRef(interfaces.get(i));
        }
        max = fields.size();
        dest.writeU2(max);
        for (i = 0; i < max; i++) {
            fields.get(i).write(dest);
        }
        max = methods.size();
        dest.writeU2(max);
        for (i = 0; i < max; i++) {
            methods.get(i).write(dest);
        }
        max = attributes.size();
        dest.writeU2(max);
        for (i = 0; i < max; i++) {
            attributes.get(i).write(dest);
        }
    }
201595
public void writeHeader() throws IOException, ConverterException {
        if (append) {
            return;
        }
        try {
            CompoundTag ebml = TagFactory.<CompoundTag> create("EBML").add(TagFactory.<UnsignedIntegerTag> create("EBMLVersion").setValue(1)).add(TagFactory.<UnsignedIntegerTag> create("EBMLReadVersion").setValue(1)).add(TagFactory.<UnsignedIntegerTag> create("EBMLMaxIDLength").setValue(4)).add(TagFactory.<UnsignedIntegerTag> create("EBMLMaxSizeLength").setValue(8))
                    .add(TagFactory.<StringTag> create("DocType").setValue("webm")).add(TagFactory.<UnsignedIntegerTag> create("DocTypeVersion").setValue(3)).add(TagFactory.<UnsignedIntegerTag> create("DocTypeReadVersion").setValue(2));
            byte[] hb = ebml.encode();
            bytesWritten += hb.length;
            dataFile.write(hb);
        } catch (IOException | ConverterException e) {
            log.error("Failed to write header", e);
            throw e;
        }
    }
329322
private void writeAttributeTypes(String name, FieldType[] types) throws IOException
   {
      m_writer.writeStartObject(name);
      for (FieldType field : types)
      {
         m_writer.writeNameValuePair(field.name().toLowerCase(), field.getDataType().getValue());
      }
      m_writer.writeEndObject();
   }
750955
private void writeFields() throws IOException {

    for (PropertyMeta property : properties) {
      property.writeFieldDefn(writer, shortName, writingAssocBean);
      writer.eol();
    }
    writer.eol();
  }
825979
void write(ByteCodeWriter out)
    throws IOException
  {
    out.write(ConstantPool.CP_FIELD_REF);
    out.writeShort(_classIndex);
    out.writeShort(_nameAndTypeIndex);
  }
1112057
public void writeHeader(BufferedWriter bufferedWriter, boolean appendLineTermination) throws IOException {
		checkEntityConfig();
		bufferedWriter.write(buildHeaderLine(appendLineTermination));
	}
537109
public void writeSetupField()
    {
        FieldStuff fieldStuff = new FieldStuff();
        ClassInfo recClassInfo = (ClassInfo)this.getMainRecord();
    // Now, write all the record methods
        Record recFileHdr = this.getRecord(FileHdr.FILE_HDR_FILE);          // Open the Agency File
        FieldData recFieldData = (FieldData)this.getRecord(FieldData.FIELD_DATA_FILE);          // Open the Agency File
        FieldIterator fieldIterator = new FieldIterator(recFileHdr, recClassInfo, recFieldData, true);
        if (!fieldIterator.hasNext())
            return;

    // Initialization method
        this.writeMethodInterface(null, "setupField", "BaseField", "int iFieldSeq", "", "Add this field in the Record's field sequence.", null);
        m_StreamOut.setTabs(+1);
        m_StreamOut.writeit("BaseField field = null;\n");

        int count = 0;
        while (fieldIterator.hasNext())
        {
            recFieldData = (FieldData)fieldIterator.next();
            String strPre = DBConstants.BLANK;
            if (this.ignoreFieldData(recFieldData))
                strPre = "//";

            this.getFieldData(fieldStuff, false);

            if ((recFieldData.getField(FieldData.FIELD_TYPE).getString().equalsIgnoreCase(FieldTypeField.VIRTUAL_FIELD)) || (fieldStuff.bNotNullField))
                strPre = DBConstants.BLANK;
            m_StreamOut.writeit(strPre + "if (iFieldSeq == " + count++ + ")\n");
            String strFieldType = recFieldData.getField(FieldData.FIELD_TYPE).getString();
            String strDefaultValue = recFieldData.getField(FieldData.DEFAULT_VALUE).getString();
            String strMinimumLength = recFieldData.getField(FieldData.MINIMUM_LENGTH).getString();
            boolean bHidden = recFieldData.getField(FieldData.HIDDEN).getState();
            if (strMinimumLength.equals("0"))
                strMinimumLength = "";
            if ((strFieldType.equalsIgnoreCase(FieldTypeField.VIRTUAL_FIELD)) || (fieldStuff.bNotNullField) || (strDefaultValue.equalsIgnoreCase("old")) || (strMinimumLength.length() > 0) || bHidden)   // Virtual BaseField?
                m_StreamOut.writeit(strPre + "{\n");
            if (!fieldStuff.strFieldDesc.equals("null"))
                fieldStuff.strFieldDesc = "\"" + fieldStuff.strFieldDesc + "\"";
            fieldStuff.strFieldDesc = "null";   // Use the resource file!
            if ((fieldStuff.strFieldClass == null) || (fieldStuff.strFieldClass.length() == 0))
                fieldStuff.strFieldClass = "StringField";

            m_StreamOut.writeit(strPre + "\tfield = new " + fieldStuff.strFieldClass + "(this, " + this.convertNameToConstant(fieldStuff.strFileFieldName) + ", " + fieldStuff.strFieldLength + ", " + fieldStuff.strFieldDesc + ", " + fieldStuff.strDefaultField + ");\n");

            if (strFieldType.equalsIgnoreCase(FieldTypeField.VIRTUAL_FIELD))     // Virtual BaseField?
                m_StreamOut.writeit(strPre + "\tfield.setVirtual(true);\n");
            if (bHidden)     // Virtual BaseField?
                m_StreamOut.writeit(strPre + "\tfield.setHidden(true);\n");
            if (fieldStuff.bNotNullField)
                m_StreamOut.writeit(strPre + "\tfield.setNullable(false);\n");
            if (strDefaultValue.equalsIgnoreCase("old"))    // Virtual BaseField?
                m_StreamOut.writeit(strPre + "\tfield.addListener(new InitOnceFieldHandler(null));\n");
            if (strMinimumLength.length() > 0)  // Virtual BaseField?
                m_StreamOut.writeit(strPre + "\tfield.setMinimumLength(" + strMinimumLength + ");\n");
            if ((strFieldType.equalsIgnoreCase(FieldTypeField.VIRTUAL_FIELD)) || (fieldStuff.bNotNullField) || (strDefaultValue.equalsIgnoreCase("old")) || (strMinimumLength.length() > 0) || bHidden)   // Virtual BaseField?
                m_StreamOut.writeit(strPre + "}\n");
        }
        m_StreamOut.writeit("if (field == null)\n");
        m_StreamOut.setTabs(+1);
        m_StreamOut.writeit("field = super.setupField(iFieldSeq);\n");
        m_StreamOut.setTabs(-1);
        m_StreamOut.writeit("return field;\n");
        m_StreamOut.setTabs(-1);
        m_StreamOut.writeit("}\n");
        fieldIterator.free();
    }
1341945
def _write_mef(self, key, extlist, outfile):
        """"""
        channel = self.fv.get_channel(self.chname)
        with fits.open(outfile, mode='update') as pf:
            # Process each modified data extension
            for idx in extlist:
                k = '{0}[{1}]'.format(key, self._format_extname(idx))
                image = channel.datasrc[k]

                # Insert data and header into output HDU
                pf[idx].data = image.get_data()
                self._write_header(image, pf[idx])

            # Write history to PRIMARY
            self._write_history(key, pf['PRIMARY'])
678746
private function _writeCFHeader(){
		$record	  = 0x01B0;			   // Record identifier
		$length	  = 0x0016;			   // Bytes to follow

		$numColumnMin = null;
		$numColumnMax = null;
		$numRowMin = null;
		$numRowMax = null;
		$arrConditional = array();
		foreach ($this->_phpSheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) {
			foreach ($conditionalStyles as $conditional) {
				if($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION
						|| $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS){
					if(!in_array($conditional->getHashCode(), $arrConditional)){
						$arrConditional[] = $conditional->getHashCode();
					}
					// Cells
					$arrCoord = PHPExcel_Cell::coordinateFromString($cellCoordinate);
					if(!is_numeric($arrCoord[0])){
						$arrCoord[0] = PHPExcel_Cell::columnIndexFromString($arrCoord[0]);
					}
					if(is_null($numColumnMin) || ($numColumnMin > $arrCoord[0])){
						$numColumnMin = $arrCoord[0];
					}
					if(is_null($numColumnMax) || ($numColumnMax < $arrCoord[0])){
						$numColumnMax = $arrCoord[0];
					}
					if(is_null($numRowMin) || ($numRowMin > $arrCoord[1])){
						$numRowMin = $arrCoord[1];
					}
					if(is_null($numRowMax) || ($numRowMax < $arrCoord[1])){
						$numRowMax = $arrCoord[1];
					}
				}
			}
		}
		$needRedraw = 1;
		$cellRange = pack('vvvv', $numRowMin-1, $numRowMax-1, $numColumnMin-1, $numColumnMax-1);

		$header	  = pack('vv', $record, $length);
		$data	  = pack('vv', count($arrConditional), $needRedraw);
		$data     .= $cellRange;
		$data     .= pack('v', 0x0001);
		$data     .= $cellRange;
		$this->_append($header . $data);
	}
602402
public void writeHeader(List<? extends AttributeProvider> providers) throws IOException, AttributeException {
		if (this.columns == null) {
			this.columns = extractColumns(providers);
			writeDescriptionHeader(providers.size());
			writeColumns();
		}
	}
1142770
def write(self, client):
        
        assert(isinstance(self._bytearray, DB))
        assert(self.row_size >= 0)

        db_nr = self._bytearray.db_number
        offset = self.db_offset
        data = self.get_bytearray()[offset:offset+self.row_size]
        db_offset = self.db_offset

        # indicate start of write only area of row!
        if self.row_offset:
            data = data[self.row_offset:]
            db_offset += self.row_offset

        client.db_write(db_nr, db_offset, data)
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);
    }
1100317
public static void write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws IOException {
        Arrays.checkOffsetAndCount(bytes.length, byteOffset, byteCount);
        if (byteCount == 0) {
            return;
        }
        try {
            while (byteCount > 0) {
                int bytesWritten = Libcore.os.write(fd, bytes, byteOffset, byteCount);
                byteCount -= bytesWritten;
                byteOffset += bytesWritten;
            }
        } catch (ErrnoException errnoException) {
            throw errnoException.rethrowAsIOException();
        }
    }
1169623
def write
      begin
        buf = [ @flags, @length, @id, @crc].pack(FORMAT)
        crc = Zlib.crc32(buf, 0)
        @file.seek(@addr)
        @file.write(buf + [ crc ].pack('L'))
      rescue IOError => e
        PEROBS.log.fatal "Cannot write blob header into flat file DB: " +
          e.message
      end
    end
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);
        }
    }
381420
public void writeHeader( DataOutputStream out ) 
                           throws IOException { 
    out.writeByte( type );
    out.writeInt( bytesPerChecksum );
  }