Java Utililty Methods DataOutput Write String

List of utility methods to do DataOutput Write String

Description

The list of methods to do DataOutput Write String are organized into topic(s).

Method

voidwriteString(String s, DataOutput stream)
write String
if (s == null) {
    stream.writeInt(-1);
    return;
final int len = s.length();
stream.writeInt(len);
if (len == 0) {
    return;
...
voidwriteString(String s, DataOutput stream)
write String
if (s == null) {
    stream.writeInt(-1);
    return;
char[] chars = s.toCharArray();
byte[] bytes = new byte[chars.length * 2];
stream.writeInt(chars.length);
for (int i = 0, i2 = 0; i < chars.length; i++, i2 += 2) {
...