MCPcopy
hub / github.com/google/guava / asWriter

Method asWriter

guava/src/com/google/common/io/CharStreams.java:359–364  ·  view source on GitHub ↗

Returns a Writer that sends all output to the given {@link Appendable} target. Closing the writer will close the target if it is {@link Closeable}, and flushing the writer will flush the target if it is {@link java.io.Flushable}. @param target the object to which output will be sent @return a new W

(Appendable target)

Source from the content-addressed store, hash-verified

357 * @return a new Writer object, unless target is a Writer, in which case the target is returned
358 */
359 public static Writer asWriter(Appendable target) {
360 if (target instanceof Writer) {
361 return (Writer) target;
362 }
363 return new AppendableWriter(target);
364 }
365}

Callers 2

copyMethod · 0.95
testAsWriterMethod · 0.95

Calls

no outgoing calls

Tested by 1

testAsWriterMethod · 0.76