Write the HORIZONTALPAGEBREAKS and VERTICALPAGEBREAKS BIFF records.
509118
private function _writeBreaks()
	{
		// initialize
		$vbreaks = array();
		$hbreaks = array();

		foreach ($this->_phpSheet->getBreaks() as $cell => $breakType) {
			// Fetch coordinates
			$coordinates = PHPExcel_Cell::coordinateFromString($cell);

			// Decide what to do by the type of break
			switch ($breakType) {
				case PHPExcel_Worksheet::BREAK_COLUMN:
					// Add to list of vertical breaks
					$vbreaks[] = PHPExcel_Cell::columnIndexFromString($coordinates[0]) - 1;
					break;

				case PHPExcel_Worksheet::BREAK_ROW:
					// Add to list of horizontal breaks
					$hbreaks[] = $coordinates[1];
					break;

				case PHPExcel_Worksheet::BREAK_NONE:
				default:
					// Nothing to do
					break;
			}
		}

		//horizontal page breaks
		if (!empty($hbreaks)) {

			// Sort and filter array of page breaks
			sort($hbreaks, SORT_NUMERIC);
			if ($hbreaks[0] == 0) { // don't use first break if it's 0
				array_shift($hbreaks);
			}

			$record  = 0x001b;			   // Record identifier
			$cbrk	= count($hbreaks);	   // Number of page breaks
			$length  = 2 + 6 * $cbrk;	  // Bytes to follow

			$header  = pack("vv", $record, $length);
			$data	= pack("v",  $cbrk);

			// Append each page break
			foreach ($hbreaks as $hbreak) {
				$data .= pack("vvv", $hbreak, 0x0000, 0x00ff);
			}

			$this->_append($header . $data);
		}

		// vertical page breaks
		if (!empty($vbreaks)) {

			// 1000 vertical pagebreaks appears to be an internal Excel 5 limit.
			// It is slightly higher in Excel 97/200, approx. 1026
			$vbreaks = array_slice($vbreaks, 0, 1000);

			// Sort and filter array of page breaks
			sort($vbreaks, SORT_NUMERIC);
			if ($vbreaks[0] == 0) { // don't use first break if it's 0
				array_shift($vbreaks);
			}

			$record  = 0x001a;			   // Record identifier
			$cbrk	= count($vbreaks);	   // Number of page breaks
			$length  = 2 + 6 * $cbrk;	  // Bytes to follow

			$header  = pack("vv",  $record, $length);
			$data	= pack("v",   $cbrk);

			// Append each page break
			foreach ($vbreaks as $vbreak) {
				$data .= pack("vvv", $vbreak, 0x0000, 0xffff);
			}

			$this->_append($header . $data);
		}
	}
1238880
def _write_vcf_breakend(brend, out_handle):
    
    out_handle.write("{0}\n".format("\t".join(str(x) for x in
        [brend.chrom, brend.pos + 1, brend.id, brend.ref, brend.alt,
         ".", "PASS", brend.info])))
1136297
def _writeblocks(cls, blocks, available, cont_size, padding_func):
        """"""

        # write everything except padding
        data = bytearray()
        for block in blocks:
            if isinstance(block, Padding):
                continue
            data += cls._writeblock(block)
        blockssize = len(data)

        # take the padding overhead into account. we always add one
        # to make things simple.
        padding_block = Padding()
        blockssize += len(cls._writeblock(padding_block))

        # finally add a padding block
        info = PaddingInfo(available - blockssize, cont_size)
        padding_block.length = min(info._get_padding(padding_func),
                                   cls._MAX_SIZE)
        data += cls._writeblock(padding_block, is_last=True)

        return data
897371
@InService(SegmentServiceImpl.class)
  public
  Page writePage(Page page,
                 long oldSequence,
                 int saveLength,
                 int saveTail,
                 int saveSequence,
                 Result<Integer> result)
  {
    if (isClosed()) {
      return null;
    }
    
    // Type type = page.getType();
    int pid = page.getId();
    int nextPid = page.getNextId();
    
    WriteStream out = out();
    
    int head = (int) out.position();
    
    try {
      int available = getAvailable();
      
      if (available < head + page.size()) {
        return null;
      }
      
      Page newPage = page.writeCheckpoint(_table, this, oldSequence,
                                          saveLength, saveTail, saveSequence);

      if (newPage == null) {
        return null;
      }
      
      newPage.setSequence(getSequence());
      
      out = out();
      
      int tail = (int) out.position();

      if (addIndex(out, page, newPage,
                   saveSequence, newPage.getLastWriteType(), 
                   pid, nextPid, head, tail - head,
                   result)) {
        return newPage;
      }
      else {
        return null;
      }
    } catch (Exception e) {
      e.printStackTrace();
      return null;
    }
  }
432955
private void writeCalendars(List<ProjectCalendar> records)
   {

      //
      // Write project calendars
      //
      for (ProjectCalendar record : records)
      {
         m_buffer.setLength(0);
         m_buffer.append("CLDR ");
         m_buffer.append(SDEFmethods.lset(record.getUniqueID().toString(), 2)); // 2 character used, USACE allows 1
         String workDays = SDEFmethods.workDays(record); // custom line, like NYYYYYN for a week
         m_buffer.append(SDEFmethods.lset(workDays, 8));
         m_buffer.append(SDEFmethods.lset(record.getName(), 30));
         m_writer.println(m_buffer);
      }
   }
806889
public static void writeRecord(final List<VcfSample> samples, final VcfRecord record, final PrintWriter writer) {
        checkNotNull(samples);
        checkNotNull(record);
        checkNotNull(writer);

        StringBuilder sb = new StringBuilder();
        sb.append(record.getChrom());
        sb.append("\t");
        sb.append(record.getPos());

        sb.append("\t");
        if (record.getId().length == 0) {
            sb.append(".");
        }
        else {
            sb.append(Joiner.on(";").join(record.getId()));
        }

        sb.append("\t");
        sb.append(record.getRef());
        sb.append("\t");
        sb.append(Joiner.on(",").join(record.getAlt()));

        sb.append("\t");
        if (Double.isNaN(record.getQual())) {
            sb.append(".");
        }
        else {
            sb.append((int) record.getQual());
        }

        sb.append("\t");
        sb.append(Joiner.on(";").join(record.getFilter()));

        sb.append("\t");
        if (record.getInfo().isEmpty()) {
            sb.append(".");
        }
        else {
            sb.append(Joiner.on(";").withKeyValueSeparator("=").join(record.getInfo().asMap()));
        }

        if (!samples.isEmpty()) {
            sb.append("\t");
            sb.append(Joiner.on(":").join(record.getFormat()));
            for (VcfSample sample : samples) {
                sb.append("\t");

                List<String> values = new ArrayList<String>();
                for (String formatId : record.getFormat()) {
                    List<String> fieldValues = record.getGenotypes().get(sample.getId()).getFields().get(formatId);
                    values.add(fieldValues.isEmpty() ? "." : Joiner.on(",").join(fieldValues));
                }
                sb.append(Joiner.on(":").join(values));
            }
        }
        writer.println(sb.toString());
    }
834746
private void writeBottom(boolean hasNext) throws IOException {
        String template = Template.readResourceAsStream("com/btaz/util/templates/html-table-footer.ftl");
        Map<String,Object> map = new HashMap<String,Object>();
        String prev = " ";
        String next = "";
        if(currentPageNumber > 1) {
            prev = "<a href=\"" + createFilename(1) + "\">First</a> &nbsp; "
            + "<a href=\"" + createFilename(currentPageNumber-1) + "\">Previous</a> &nbsp; ";
        }
        if(hasNext) {
            next = "<a href=\"" + createFilename(currentPageNumber+1) + "\">Next</a>";
        }
        map.put("pageNavigation", prev + next);
        template = Template.transform(template, map);
        writer.write(template);
        writer.close();
        writer = null;
    }
587717
def write_headers(self):
        
        h1 = []
        h2 = []
        for m in self.values():
            h2.append(m.render_subtitle())
            h1.append(m.render_title())

        stdout.write(" ".join(h1))
        stdout.write("\n\r")
        c = _ansi["gray"] + "|" + _ansi["reset"]
        stdout.write(c.join(h2))
        stdout.write("\n\r")
        stdout.flush()

        if self._csvfile:
            header_row = []
            for m in self.values():
                if isinstance(m, MultiMetric):
                    for subm in m.values():
                        header_row.append(
                            "{}_{}".format(m.title, subm.title)
                        )
                else:
                    if m.subtitle:
                        header_row.append(
                            "{}_{}".format(m.title, m.subtitle)
                        )
                    else:
                        header_row.append(m.title)
            self._write_csv_row(header_row, rewrite=True)
571531
def format_records(records):
    """"""
    formatted = list()
    for record_ in records:
        formatted.append(format_record(record_))
    return formatted
703534
@InService(TableWriterService.class)
  public void writeBlobPage(PageBlob page,
                               int saveSequence,
                               Result<Integer> result)
  {
    SegmentStream sOut = getBlobStream();
    
    int saveLength = 0;
    int saveTail = 0;
    
    if (_blobSizeMax < page.getLength()) {
      _blobSizeMax = page.getLength();
      calculateSegmentSize();
    }
    
    sOut.writePage(this, page, saveLength, saveTail, saveSequence, result);
    
    _isBlobDirty = true;
  }
1372670
public void write(String... columns) throws DataUtilException {
        if(columns.length != tableColumns) {
            throw new DataUtilException("Invalid column count. Expected " + tableColumns + " but found: "
                    + columns.length);
        }
        try {
            if(currentRow == 0) {
                // capture header row
                this.headerRowColumns = columns;
                writeTop();
                writeRow(headerRowColumns);
            } else if(maxRowsPerPage > 1 && currentRow % maxRowsPerPage == 0) {
                writeBottom(true);
                currentPageNumber = (currentRow/maxRowsPerPage) + 1;
                writeTop();
                writeRow(headerRowColumns);
                currentRow += 1;
                writeRow(columns);
            } else {
                writeRow(columns);
            }
            currentRow += 1;
        } catch (Exception e) {
            throw new DataUtilException(e);
        }
    }
84362
def write(self, fptr):
        
        self._write_validate()

        # Very similar to the way a superbox is written.
        orig_pos = fptr.tell()
        fptr.write(struct.pack('>I4s', 0, b'dtbl'))

        # Write the number of data entry url boxes.
        write_buffer = struct.pack('>H', len(self.DR))
        fptr.write(write_buffer)

        for box in self.DR:
            box.write(fptr)

        end_pos = fptr.tell()
        fptr.seek(orig_pos)
        fptr.write(struct.pack('>I', end_pos - orig_pos))
        fptr.seek(end_pos)
130381
public static void writeRecords(final List<VcfSample> samples,
                                    final List<VcfRecord> records,
                                    final PrintWriter writer) {
        checkNotNull(samples);
        checkNotNull(records);
        checkNotNull(writer);

        for (VcfRecord record : records) {
            writeRecord(samples, record, writer);
        }
    }
495405
private function _writeSheetLayout()
	{
		if (!$this->_phpSheet->isTabColorSet()) {
			return;
		}

		$recordData = pack(
			'vvVVVvv'
			, 0x0862
			, 0x0000		// unused
			, 0x00000000	// unused
			, 0x00000000	// unused
			, 0x00000014	// size of record data
			, $this->_colors[$this->_phpSheet->getTabColor()->getRGB()]	// color index
			, 0x0000		// unused
		);

		$length = strlen($recordData);

		$record = 0x0862; // Record identifier
		$header = pack('vv', $record, $length);
		$this->_append($header . $recordData);
	}
889199
void write(Writer out)
         throws IOException
    {
        out.write("<frame scrolling=\""+scrolling+"\""+resize+border);
        
        if(src!=null)
            out.write(" src=\""+src+"\"");
        if(name!=null)
            out.write(" name=\""+name+"\"");
        out.write(">");
    }
1179357
def __shpRecords(self):
        """"""
        f = self.__getFileObj(self.shp)
        f.seek(100)
        recNum = 1
        for s in self._shapes:
            self._offsets.append(f.tell())
            # Record number, Content length place holder
            f.write(pack(">2i", recNum, 0))
            recNum += 1
            start = f.tell()
            # Shape Type
            f.write(pack("<i", s.shapeType))
            # All shape types capable of having a bounding box
            if s.shapeType in (3,5,8,13,15,18,23,25,28,31):
                try:
                    f.write(pack("<4d", *self.__bbox([s])))
                except error:
                    raise ShapefileException("Falied to write bounding box for record %s. Expected floats." % recNum)
            # Shape types with parts
            if s.shapeType in (3,5,13,15,23,25,31):
                # Number of parts
                f.write(pack("<i", len(s.parts)))
            # Shape types with multiple points per record
            if s.shapeType in (3,5,8,13,15,23,25,31):
                # Number of points
                f.write(pack("<i", len(s.points)))
            # Write part indexes
            if s.shapeType in (3,5,13,15,23,25,31):
                for p in s.parts:
                    f.write(pack("<i", p))
            # Part types for Multipatch (31)
            if s.shapeType == 31:
                for pt in s.partTypes:
                    f.write(pack("<i", pt))
            # Write points for multiple-point records
            if s.shapeType in (3,5,8,13,15,23,25,31):
                try:
                    [f.write(pack("<2d", *p[:2])) for p in s.points]
                except error:
                    raise ShapefileException("Failed to write points for record %s. Expected floats." % recNum)
            # Write z extremes and values
            if s.shapeType in (13,15,18,31):
                try:
                    f.write(pack("<2d", *self.__zbox([s])))
                except error:
                    raise ShapefileException("Failed to write elevation extremes for record %s. Expected floats." % recNum)
                try:
                    [f.write(pack("<d", p[2])) for p in s.points]
                except error:
                    raise ShapefileException("Failed to write elevation values for record %s. Expected floats." % recNum)
            # Write m extremes and values
            if s.shapeType in (23,25,31):
                try:
                    f.write(pack("<2d", *self.__mbox([s])))
                except error:
                    raise ShapefileException("Failed to write measure extremes for record %s. Expected floats" % recNum)
                try:
                    [f.write(pack("<d", p[3])) for p in s.points]
                except error:
                    raise ShapefileException("Failed to write measure values for record %s. Expected floats" % recNum)
            # Write a single point
            if s.shapeType in (1,11,21):
                try:
                    f.write(pack("<2d", s.points[0][0], s.points[0][1]))
                except error:
                    raise ShapefileException("Failed to write point for record %s. Expected floats." % recNum)
            # Write a single Z value
            if s.shapeType == 11:
                try:
                    f.write(pack("<1d", s.points[0][2]))
                except error:
                    raise ShapefileException("Failed to write elevation value for record %s. Expected floats." % recNum)
            # Write a single M value
            if s.shapeType in (11,21):
                try:
                    f.write(pack("<1d", s.points[0][3]))
                except error:
                    raise ShapefileException("Failed to write measure value for record %s. Expected floats." % recNum)
            # Finalize record length as 16-bit words
            finish = f.tell()
            length = (finish - start) // 2
            self._lengths.append(length)
            # start - 4 bytes is the content length field
            f.seek(start-4)
            f.write(pack(">i", length))
            f.seek(finish)
1133158
def WriteBlobs(self, blob_id_data_map, cursor=None):
    """"""
    chunks = []
    for blob_id, blob in iteritems(blob_id_data_map):
      chunks.extend(_BlobToChunks(blob_id.AsBytes(), blob))
    for values in _PartitionChunks(chunks):
      _Insert(cursor, "blobs", values)