This writes a feature's individual value, using the human readable name if possible, to a StringBuilder
168202
private void debugFeatureValue(String feature, int index, ConcatVector vector, BufferedWriter bw) throws IOException {
        bw.write("\t");
        if (sparseFeatureIndex.containsKey(feature) && sparseFeatureIndex.get(feature).values().contains(index)) {
            // we can map this index to an interpretable string, so we do
            bw.write("SPARSE VALUE \"");
            bw.write(reverseSparseFeatureIndex.get(feature).get(index));
            bw.write("\"");
        }
        else {
            // we can't map this to a useful string, so we default to the number
            bw.write(Integer.toString(index));
        }
        bw.write(": ");
        bw.write(Double.toString(vector.getValueAt(featureToIndex.getOrDefault(feature, -1), index)));
        bw.write("\n");
    }
480608
public void writeStringField(String fieldName, String value)
        throws IOException, JsonGenerationException
    {
        writeFieldName(fieldName);
        writeString(value);
    }
984054
void writeConfigProps(Definition def, Writer out, int indent) throws IOException
   {
      if (getConfigProps(def) == null)
         return;

      for (int i = 0; i < getConfigProps(def).size(); i++)
      {
         String name = getConfigProps(def).get(i).getName();
         String upcaseName = upcaseFirst(name);
         //set
         writeWithIndent(out, indent, "/** \n");
         writeWithIndent(out, indent, " * Set " + name);
         writeEol(out);
         writeWithIndent(out, indent, " * @param " + name + " The value\n");
         writeWithIndent(out, indent, " */\n");

         writeWithIndent(out, indent, "public void set" +
               upcaseName +
               "(" +
               getConfigProps(def).get(i).getType() +
               " " +
               name +
               ")");
         writeLeftCurlyBracket(out, indent);
         writeWithIndent(out, indent + 1, "this." + name + " = " + name + ";");
         writeRightCurlyBracket(out, indent);
         writeEol(out);

         //get
         writeWithIndent(out, indent, "/** \n");
         writeWithIndent(out, indent, " * Get " + name);
         writeEol(out);
         writeWithIndent(out, indent, " * @return The value\n");
         writeWithIndent(out, indent, " */\n");
         writeWithIndent(out, indent, "public " +
               getConfigProps(def).get(i).getType() +
               " get" +
               upcaseName +
               "()");
         writeLeftCurlyBracket(out, indent);
         writeWithIndent(out, indent + 1, "return " + name + ";");
         writeRightCurlyBracket(out, indent);
         writeEol(out);
      }
   }
359925
public void setStringAttribute(String name, String value) {
		ensureValue();
		Attribute attribute = new StringAttribute(value);
		attribute.setEditable(isEditable(name));
		getValue().getAllAttributes().put(name, attribute);
	}
1162724
public void writeValue (String name, Object value) {
		try {
			writer.name(name);
		} catch (IOException ex) {
			throw new JsonException(ex);
		}
		if (value == null)
			writeValue(value, null, null);
		else
			writeValue(value, value.getClass(), null);
	}
662239
private void writeValue(int curLen) {
        for (int i=0; i < curLen; i++)
            newData[newDataPos++] = data[dataPos++];
    }
895523
protected void writeAttributeValue(String value, Writer out) throws IOException {
		// .[apostrophe and <, & escaped],
		final char quot = attributeUseApostrophe ? '\'' : '"';
		final String quotEntity = attributeUseApostrophe ? "&apos;" : "&quot;";

		int pos = 0;
		for (int i = 0; i < value.length(); i++) {
			char ch = value.charAt(i);
			if (ch == '&') {
				if (i > pos)
					out.write(value.substring(pos, i));
				out.write("&amp;");
				pos = i + 1;
			}
			if (ch == '<') {
				if (i > pos)
					out.write(value.substring(pos, i));
				out.write("&lt;");
				pos = i + 1;
			} else if (ch == quot) {
				if (i > pos)
					out.write(value.substring(pos, i));
				out.write(quotEntity);
				pos = i + 1;
			} else if (ch < 32) {
				// in XML 1.0 only legal character are #x9 | #xA | #xD
				// and they must be escaped otherwise in attribute value they
				// are normalized to spaces
				if (ch == 13 || ch == 10 || ch == 9) {
					if (i > pos)
						out.write(value.substring(pos, i));
					out.write("&#");
					out.write(Integer.toString(ch));
					out.write(';');
					pos = i + 1;
				} else {
					if (TRACE_ESCAPING)
						System.err.println(getClass().getName() + " DEBUG ATTR value.len=" + value.length() + " " + printable(value));

					throw new IllegalStateException(
							// "character "+Integer.toString(ch)+" is not
							// allowed in output"+getLocation());
							"character " + printable(ch) + " (" + Integer.toString(ch) + ") is not allowed in output" + getLocation() + " (attr value=" + printable(value) + ")");
					// in XML 1.1 legal are [#x1-#xD7FF]
					// if(ch > 0) {
					// if(i > pos) out.write(text.substring(pos, i));
					// out.write("&#");
					// out.write(Integer.toString(ch));
					// out.write(';');
					// pos = i + 1;
					// } else {
					// throw new IllegalStateException(
					// "character zero is not allowed in XML 1.1
					// output"+getLocation());
					// }
				}
			}
		}
		if (pos > 0) {
			out.write(value.substring(pos));
		} else {
			out.write(value); // this is shortcut to the most common case
		}

	}
188582
private void _writeStringCustom(final int len)
			throws IOException, JsonGenerationException
	{
		// And then we'll need to verify need for escaping etc:
		int end = _outputTail + len;
		final int[] escCodes = _outputEscapes;
		final int maxNonEscaped = (_maximumNonEscapedChar < 1) ? 0xFFFF : _maximumNonEscapedChar;
		final int escLimit = Math.min(escCodes.length, maxNonEscaped+1);
		int escCode = 0;
		final CharacterEscapes customEscapes = _characterEscapes;

		output_loop:
		while (_outputTail < end) {
			char c;
			// Fast loop for chars not needing escaping
			escape_loop:
			while (true) {
				c = _outputBuffer[_outputTail];
				if (c < escLimit) {
					escCode = escCodes[c];
					if (escCode != 0) {
						break escape_loop;
					}
				} else if (c > maxNonEscaped) {
					escCode = CharacterEscapes.ESCAPE_STANDARD;
					break escape_loop;
				} else {
					if ((_currentEscape = customEscapes.getEscapeSequence(c)) != null) {
						escCode = CharacterEscapes.ESCAPE_CUSTOM;
						break escape_loop;
					}
				}
				if (++_outputTail >= end) {
					break output_loop;
				}
			}
			int flushLen = (_outputTail - _outputHead);
			if (flushLen > 0) {
				_writer.write(_outputBuffer, _outputHead, flushLen);
			}
			++_outputTail;
			_prependOrWriteCharacterEscape(c, escCode);
		}
	}
893874
public void writeStringLenenc(final String value) {
        if (Strings.isNullOrEmpty(value)) {
            byteBuf.writeByte(0);
            return;
        }
        writeIntLenenc(value.getBytes().length);
        byteBuf.writeBytes(value.getBytes());
    }
1328093
public void writeString(OutputStream out, String value) throws IOException {
        writeStartArray(out);
        writeStringInternal(out, value);
        writeEndArray(out);
    }
1308427
protected void writeValue( VarValueDef value)
    {
    ConditionWriter conditionWriter = new ConditionWriter( value.getCondition());

    xmlWriter_
      .element( VALUE_TAG)
      .attribute( NAME_ATR, String.valueOf( value.getName()))
      .attributeIf( value.getType() == FAILURE, FAILURE_ATR, "true")
      .attributeIf( value.getType() == ONCE, ONCE_ATR, "true")
      .attributeIf( WHEN_ATR, conditionWriter.getWhenAttribute())
      .attributeIf( PROPERTY_ATR, propertyList( toStream( value.getProperties())))
      .contentIf(
        value.getAnnotationCount() > 0 || conditionWriter.hasWhenElement(),
        () -> { writeAnnotations( value); conditionWriter.writeWhenElement(); })
      .write();
    }
970663
private void writeBean(String currentIndent, String tagName, StringBuilder attrs, Class<?> propType, Bean value) throws IOException {
        if (value == null) {
            throw new IllegalArgumentException("Bean cannot be null");
        }
        output.append(currentIndent).append('<').append(tagName).append(attrs);
        if (value.getClass() != propType) {
            String typeStr = SerTypeMapper.encodeType(value.getClass(), settings, basePackage, knownTypes);
            appendAttribute(output, TYPE, typeStr);
        }
        if (willWriteBean(value)) {
            output.append('>').append(settings.getNewLine());
            writeBean(value, currentIndent + settings.getIndent());
            output.append(currentIndent).append('<').append('/').append(tagName).append('>').append(settings.getNewLine());
        } else {
            output.append('/').append('>').append(settings.getNewLine());
        }
    }
171902
def write_string(self, value, length):
        """"""
        format = '!' + str(length) + 's'
        self.data.append(struct.pack(format, value))
        self.size += length
1279050
public static void writeValue(JsonWriter writer, String name, String value) throws IOException {
        writer.name(name).value(value);
    }
1278982
protected void buildPropertyString(StringBuilder buffer) {
		buffer.append("input = ").append(this.input).append("\n"); //$NON-NLS-1$//$NON-NLS-2$
		buffer.append("output = ").append(this.output).append("\n"); //$NON-NLS-1$//$NON-NLS-2$
		buffer.append("testInput = ").append(this.testInput).append("\n"); //$NON-NLS-1$//$NON-NLS-2$
		buffer.append("testOutput = ").append(this.testOutput).append("\n"); //$NON-NLS-1$//$NON-NLS-2$
	}
676023
private String getFeatureString(Set<String> featureNames) {
        StringBuilder featureBuilder = new StringBuilder();

        if (featureNames != null) {
            Iterator<String> iter = featureNames.iterator();
            while (iter.hasNext()) {
                featureBuilder.append(iter.next());
                if (iter.hasNext())
                    featureBuilder.append(',');
            }
        }
        return featureBuilder.toString();
    }
694515
static String getValue(final Map<String, Features> featureTable, final String extension) {
        final List<String> buf = new ArrayList<>();
        for (final Features f : featureTable.values()) {
            final List<String> v = f.getFeature(extension);
            if (v != null) {
                buf.addAll(v);
            }
        }
        if (buf.isEmpty()) {
            return null;
        } else {
            return StringUtils.join(buf, ",");
        }
    }