Reusable Java library of general tools with minimal external dependencies.
For questions or support, please contact us:
Email: support@aoindustries.com
Phone: 1-800-519-9541
Phone: +1-251-607-9556
Web: https://www.aoindustries.com/contact
public interface Writable
| Modifier and Type | Method and Description |
|---|---|
long |
getLength()
Gets the number of characters represented by this Writable.
|
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.
|
long getLength()
throws IOException
IOExceptionboolean isFastToString()
isFastToString returns true.
Note: As of Java 1.7.0_06, String.substring(int, int) and related operations now
copy 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(java.io.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(java.io.Writer, long, long)IOExceptionCopyright © 2000–2016 AO Industries, Inc.. All rights reserved.