public JniStream writeString(String value) throws IOException { if(0 == value.length()) { tail = sink.writeByteArray(EMPTY_STRING, this, tail); return this; } tail = sink.writeByte( (byte)0, // null character this, sink.writeStrUTF8FixedDelimited( value, true, this, sink.writeByte( (byte)WIRETYPE_STRING, this, tail))); return this; }