Writes a String to the given output.
The written string can be read with {@link #readString(DataInputView)}.

@param str The string to write
@param out The output to write to

@throws IOException Thrown, if the writing or the serialization fails.
971057
public static void writeString(@Nonnull String str, DataOutputView out) throws IOException {
		checkNotNull(str);
		StringValue.writeString(str, out);
	}
972796
public void write(DataOutput out) throws IOException {
    WritableUtils.writeVInt(out, splits.length);
    for (InputSplit s : splits) {
      Text.writeString(out, s.getClass().getName());
    }
    for (InputSplit s : splits) {
      s.write(out);
    }
  }
295046
public void write(String s) throws IOException
  {
    int n = s.length();
    for (int i = 0; i < n; i++)
    {
      m_os.write(s.charAt(i));
    }
  }
417568
public void write(DataOutput out) throws IOException {
    WritableUtils.writeVInt(out, values.length);
    WritableUtils.writeVLong(out, written);
    for (int i = 0; i < values.length; ++i) {
      Text.writeString(out, values[i].getClass().getName());
    }
    for (int i = 0; i < values.length; ++i) {
      if (has(i)) {
        values[i].write(out);
      }
    }
  }
595364
private void writeSimpleString(OutputStream out, CharSequence value) throws IOException {
        out.write('"');
        for (int i = 0; i < value.length(); i++) {
            out.write(value.charAt(i));
        }
        out.write('"');
    }
321454
public void writeLongUTF(String str) throws IOException {
		int length = str.length();
		writeCompressedInt(length);
		for(int position = 0; position<length; position+=20480) {
			int blockLength = length - position;
			if(blockLength>20480) blockLength = 20480;
			String block = str.substring(position, position+blockLength);
			writeUTF(block);
		}
	}
827036
private void writeStringToFile(String str, File file) throws IOException {
        if (!file.exists() && file.isDirectory()) {
            return;
        }

        try (BufferedWriter bw = new BufferedWriter(WriterFactory.newWriter(file, this.encoding))) {
            bw.write(str);
        }
    }
932118
@Override
	public void write(DataOutputView out) throws IOException {
		out.writeInt(length);
		out.writeInt(position);

		out.write(data, 0, position);
	}
829916
public void writeToWriter(Writer out) throws IOException
  {
    int ch;

    while ((ch = readChar()) >= 0) {
      out.write((char) ch);
    }
  }
74942
public static void writeStringOpt(DataOutput out, String str) 
      throws IOException{
    if (str == null) {
      WritableUtils.writeVInt(out, NULL_STRING_LENGTH);
      return;
    }
    final int len = str.length();
    TempArrays ta = UTF8.getArrays(len);
    byte[] rawBytes = ta.byteArray;
    char[] charArray = ta.charArray;
    str.getChars(0, len, charArray, 0);

    boolean ascii = true;
    for (int i = 0; i < len; i++) {
      if (charArray[i] > UTF8.MAX_ASCII_CODE) {
        ascii = false;
        break;
      }
      rawBytes[i] = (byte) charArray[i];
    }
    if(ascii) {
      WritableUtils.writeVInt(out, len);
      out.write(rawBytes, 0, len);
    } else {
      writeString(out, str);
    }
  }
764247
@Override
    public void write(String str, int off, int len) {
        buf.append(str, off, off + len);
    }
505854
@Override
	public void write(DataOutputView out) throws IOException {
		out.writeInt(position);

		for (int i = 0; i < position; i++) {
			out.writeByte(data[i]);
		}
	}
445402
public static void writeString(String s, DataOutputStream out) throws IOException
    {
        out.writeInt(s.length());
        for (char c : s.toCharArray())
        {
            out.writeChar(c);
        }
    }
61435
public void write(DataOutput out) throws IOException {
    out.writeInt(appId.length);
    out.write(appId);
    out.writeInt(maxCount);
  }
1045785
public static void writeToFile(String str, String fileName, Charset charset) throws Exception {
    OutputStreamWriter writer = null;
    if (null == charset) {
      writer = new OutputStreamWriter(new FileOutputStream(fileName));
    } else {
      writer = new OutputStreamWriter(new FileOutputStream(fileName), charset.name());
    }
    writer.write(str);
    writer.close();
  }
666973
public void write(DataOutput out) throws IOException {
    jobid.write(out);
    Text.writeString(out, jobFile);
    Text.writeString(out, url);
    Text.writeString(out, user);
    Text.writeString(out, name);
    Text.writeString(out, queueName);
  }
640751
public static void writeToOutputStream(String s, OutputStream output) throws IOException {
		writeToOutputStream(s, output, null);
	}