public class DataOutput extends DataOutputStream
DataOutputStream with additional convenience methods.| Constructor and Description |
|---|
DataOutput(OutputStream out) |
| Modifier and Type | Method and Description |
|---|---|
int |
writeInt(int value,
boolean optimizePositive)
Writes a 1-5 byte int.
|
void |
writeString(String value)
Writes a length and then the string as UTF8.
|
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFclose, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwritepublic DataOutput(OutputStream out)
public int writeInt(int value,
boolean optimizePositive)
throws IOException
optimizePositive - If true, small positive numbers will be more efficient (1 byte) and small negative numbers will be
inefficient (5 bytes).IOExceptionpublic void writeString(@Null String value) throws IOException
value - May be null.IOExceptionCopyright © 2021. All rights reserved.