Write the <a:gsLst> element.
7010
def write_a_gs_lst(gradient)
      positions = gradient[:positions]
      colors    = gradient[:colors]

      @writer.tag_elements('a:gsLst') do
        (0..colors.size-1).each do |i|
          pos = (positions[i] * 1000).to_i

          attributes = [ ['pos', pos] ]
          @writer.tag_elements('a:gs', attributes) do

            color = color(colors[i])

            # Write the a:srgbClr element.
            # TODO: Wait for a feature request to support transparency.
            write_a_srgb_clr( color );
          end
        end
      end
    end
256653
private void writeSimple(String currentIndent, String tagName, StringBuilder attrs, Class<?> declaredType, Object value) throws IOException {
        Class<?> effectiveType;
        if (declaredType == Object.class) {
            Class<?> realType = value.getClass();
            if (realType != String.class) {
                effectiveType = settings.getConverter().findTypedConverter(realType).getEffectiveType();
                String typeStr = SerTypeMapper.encodeType(effectiveType, settings, basePackage, knownTypes);
                appendAttribute(attrs, TYPE, typeStr);
            } else {
                effectiveType = realType;
            }
        } else if (settings.getConverter().isConvertible(declaredType) == false) {
            effectiveType = settings.getConverter().findTypedConverter(value.getClass()).getEffectiveType();
            String typeStr = SerTypeMapper.encodeType(effectiveType, settings, basePackage, knownTypes);
            appendAttribute(attrs, TYPE, typeStr);
        } else {
            effectiveType = declaredType;
        }
        try {
            String converted = settings.getConverter().convertToString(effectiveType, value);
            if (converted == null) {
                throw new IllegalArgumentException("Unable to write because converter returned a null string: " + value);
            }
            output.append(currentIndent).append('<').append(tagName).append(attrs).append('>');
            appendEncoded(converted);
            output.append('<').append('/').append(tagName).append('>').append(settings.getNewLine());
        } catch (RuntimeException ex) {
            throw new IllegalArgumentException("Unable to convert type " + effectiveType.getName() + " declared as " + declaredType.getName(), ex);
        }
    }
751430
function writeTlsa(buff, val) {
  assertUndefined(val.usage, 'TLSA record requires "usage"');
  assertUndefined(val.selector, 'TLSA record requires "selector"');
  assertUndefined(val.matchingtype, 'TLSA record requires "matchingtype"');
  assertUndefined(val.buff, 'TLSA record requires "buff"');
  buff.writeUInt8(val.usage);
  buff.writeUInt8(val.selector);
  buff.writeUInt8(val.matchingtype);
  buff.copy(val.buff);
  return WRITE_RESOURCE_DONE;
}
266097
function write_cs(data, name, opts, wb, rels) {
	return (name.slice(-4)===".bin" ? write_cs_bin : write_cs_xml)(data, opts, wb, rels);
}
567329
private void writeObject(java.io.ObjectOutputStream s)
        throws java.io.IOException {

        // Write out any hidden stuff
        s.defaultWriteObject();

        // Write out all elements in the proper order.
        for (Node<E> p = first(); p != null; p = succ(p)) {
            final E item;
            if ((item = p.item) != null)
                s.writeObject(item);
        }

        // Use trailing null as sentinel
        s.writeObject(null);
    }
490075
def write_a_av_lst(shape = {})
      if shape.adjustments.respond_to?(:empty?)
        adjustments = shape.adjustments
      elsif shape.adjustments.respond_to?(:coerce)
        adjustments = [shape.adjustments]
      elsif !shape.adjustments
        adjustments = []
      end

      if adjustments.respond_to?(:empty?) && !adjustments.empty?
        @writer.tag_elements('a:avLst') do
          i = 0
          adjustments.each do |adj|
            i += 1
            # Only connectors have multiple adjustments.
            suffix = shape.connect != 0 ? i : ''

            # Scale Adjustments: 100,000 = 100%.
            adj_int = (adj * 1000).to_i

            attributes = [
                          [:name, "adj#{suffix}"],
                          [:fmla, "val #{adj_int}"]
                         ]
            @writer.empty_tag('a:gd', attributes)
          end
        end
      else
        @writer.empty_tag('a:avLst')
      end
    end
524557
public void writeSingleLineTextElement(String elementName, String text) throws IOException {
		if (elementName == null || elementName.length() == 0) {
			return;
		}
		if (text == null || text.length() == 0) {
			return;
		}
		addElementName(elementName);		
		indent();		
		writer.write("<");
		writer.write(elementName);
		writer.write(">");
		writer.write(escapeXml(text));
		writer.write("</");
		writer.write(elementName);
		writer.write(">\n");						
		removeElementName(elementName);
	}
31715
def write_ushort(self, s):
        
        if type(s) not in python.int_types:
            raise TypeError('expected an int (got:%r)' % (type(s),))

        if not 0 <= s <= 65535:
            raise OverflowError("Not in range, %d" % s)

        self.write(struct.pack("%sH" % self.endian, s))
1356914
def write y, x, s, opts={}
    return if x >= @width || y >= @height

    @w.attrset Colormap.color_for(opts[:color] || :none, opts[:highlight])
    s ||= ""
    maxl = @width - x # maximum display width width

    # fill up the line with blanks to overwrite old screen contents
    @w.mvaddstr y, x, " " * maxl unless opts[:no_fill]

    @w.mvaddstr y, x, s.slice_by_display_length(maxl)
  end
1327288
@Override
  public void write (@Nonnull final String sStr, final int nOfs, final int nLen)
  {
    m_aSB.append (sStr.substring (nOfs, nOfs + nLen));
  }
726259
private static void writeBits(StringBuilder sb, boolean r, boolean w, boolean x) {
        if (r) {
            sb.append('r');
        } else {
            sb.append('-');
        }
        if (w) {
            sb.append('w');
        } else {
            sb.append('-');
        }
        if (x) {
            sb.append('x');
        } else {
            sb.append('-');
        }
    }
154683
def writeString(self, s):
        
        s = self.context.getBytesForString(s)

        self.writeBytes(s)
57599
def write(self, text):
        """"""
        text = str(text)    # eliminate any unicode or other snigglets
        text = text.replace(IAC, IAC+IAC)
        text = text.replace(chr(10), chr(13)+chr(10))
        self.writecooked(text)
1348672
public void writeElement(String name, int type) {
        StringBuffer nsdecl = new StringBuffer();

        if (_isRootElement) {
            for (Iterator<String> iter = _namespaces.keySet().iterator(); iter
                    .hasNext();) {
                String fullName = (String) iter.next();
                String abbrev = (String) _namespaces.get(fullName);
                nsdecl.append(" xmlns:").append(abbrev).append("=\"").append(
                        fullName).append("\"");
            }
            _isRootElement = false;
        }

        int pos = name.lastIndexOf(':');
        if (pos >= 0) {
            // lookup prefix for namespace
            String fullns = name.substring(0, pos);
            String prefix = (String) _namespaces.get(fullns);
            if (prefix == null) {
                // there is no prefix for this namespace
                name = name.substring(pos + 1);
                nsdecl.append(" xmlns=\"").append(fullns).append("\"");
            } else {
                // there is a prefix
                name = prefix + ":" + name.substring(pos + 1);
            }
        } else {
            throw new IllegalArgumentException(
                    "All XML elements must have a namespace");
        }

        switch (type) {
        case OPENING:
            _buffer.append("<");
            _buffer.append(name);
            _buffer.append( nsdecl);
            _buffer.append( ">");
            break;
        case CLOSING:
            _buffer.append("</");
            _buffer.append( name);
            _buffer.append( ">\n");
            break;
        case NO_CONTENT:
        default:
            _buffer.append("<");
            _buffer.append( name);
            _buffer.append( nsdecl);
            _buffer.append( "/>");
            break;
        }
    }
719511
public static String toGML(Geometry geom) {
        if (geom == null) {
            return null;
        }
        int srid = geom.getSRID();
        GMLWriter gmlw = new GMLWriter();
        if (srid != -1 || srid != 0) {
            gmlw.setSrsName("EPSG:" + geom.getSRID());
        }
        return gmlw.write(geom);
    }
739464
def writeANVLString(ANVLDict, ordering=UNTL_XML_ORDER):
    
    lines = []
    # Loop through the ordering for the data.
    for key in ordering:
        # Make sure the element exists in the data set.
        if key in ANVLDict:
            # Get the list of elements.
            element_list = ANVLDict[key]
            # Loop through the element contents.
            for element in element_list:
                value = element.get('content', '')
                offset = len(key) + 1
                line = '%s: %s' % (key, breakString(value, 79, offset))
                lines.append(line)
    return '\n'.join(lines)
866357
def write(self, s):
        

        lines = s.splitlines(True)
        for line in lines:
            self.current_mapping.append(
                (self.generated_col, self.index, self.row, self.col_last))
            self.stream.write(line)
            if line[-1] in '\r\n':
                # start again.
                self._newline()
                self.row = 1
                self.col_current = 0
            else:
                self.col_current += len(line)
                self.generated_col = self.col_last = len(line)