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)
| 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 | } |
no outgoing calls