List of utility methods to do DataOutputStream Write String
void | writeString(DataOutputStream output, String s) write String try { output.writeShort(s.length()); output.writeChars(s); } catch (IOException e) { e.printStackTrace(); |
void | writeString(DataOutputStream outputStream, String string) write String outputStream.writeInt(string.getBytes().length); outputStream.write(string.getBytes()); |
void | writeString(final DataOutputStream out, final String str) Writes a string to the buffer. int len = str.length(); if (len > MAXLEN) { throw new IllegalArgumentException("String too long."); out.writeShort(len); for (int i = 0; i < len; ++i) { out.writeChar(str.charAt(i)); |
void | writeString(final DataOutputStream out, final String value) write String out.writeUTF(value == null ? STRING_VALUE_NULL : value); |
void | writeString(String arg, DataOutputStream data) write String byte[] abyte = arg.getBytes(); data.writeInt(abyte.length); for (byte curr : abyte) data.writeByte(curr); |
void | writeString(String s, DataOutputStream out) write String out.writeInt(s.length()); for (char c : s.toCharArray()) { out.writeChar(c); |
void | writeString(String s, DataOutputStream out) write String if (s != null) { out.write(1); out.writeUTF(s); } else { out.write(0); |
void | writeString(String s, DataOutputStream writer) write String if (s != null) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(bos); byte[] data = s.getBytes("UTF-8"); dos.writeInt(data.length); dos.write(data); dos.flush(); byte[] bs = bos.toByteArray(); ... |
void | writeString(String str, DataOutputStream dos) write String if (str == null) { dos.writeInt(-1); } else { byte[] byteArray = str.getBytes(UTF8); dos.writeInt(byteArray.length); dos.write(byteArray); |
void | writeString(String str, DataOutputStream os) write String if (str == null) { os.writeInt(-1); } else { os.writeInt(str.length()); os.writeChars(str); |