public interface Writable
| Modifier and Type | Method and Description |
|---|---|
boolean |
isFastToString()
Checks if the writable will be able to be converted toString in an extremely efficient manner.
|
String |
toString()
Anything writable must have a
toString consistent with what would be
written by the writeTo methods. |
void |
writeTo(Encoder encoder,
Writer out)
Writes a streamed version of the object's String representation using the given encoder.
|
void |
writeTo(Encoder encoder,
Writer out,
long off,
long len)
Writes a streamed version of the object's String representation using the given encoder.
|
void |
writeTo(Writer out)
Writes a streamed version of the object's String representation.
|
void |
writeTo(Writer out,
long off,
long len)
Writes a streamed version of the object's String representation.
|
boolean isFastToString()
Note: As of Java 1.7.0_06, String.substring() now copies underlying buffers.
String toString()
toString consistent with what would be
written by the writeTo methods. For larger amounts of data, it is
likely much more efficient to call the most appropriate writeTo method.void writeTo(Writer out) throws IOException
out.write(this.toString())
were called, but may be a much more efficient implementation.IOExceptionvoid writeTo(Writer out, long off, long len) throws IOException
out.write(this.toString(), off, len)
were called, but may be a much more efficient implementation.IOExceptionvoid writeTo(Encoder encoder, Writer out) throws IOException
encoder.write(this.toString(), out)
were called, but may be a much more efficient implementation.encoder - if null, no encoding is performed and will be the same as a call to writeTo(Writer)IOExceptionvoid writeTo(Encoder encoder, Writer out, long off, long len) throws IOException
encoder.write(this.toString(), off, len, out)
were called, but may be a much more efficient implementation.encoder - if null, no encoding is performed and will be the same as a call to writeTo(Writer,off,len)IOExceptionCopyright © 2016. All rights reserved.