List of utility methods to do OutputStream Write String
void | writeString(String s, OutputStream out) write String if (s == null) { writeInt(0, out); return; int len = s.length(); writeInt(len, out); for (int i = 0; i < len; i++) writChar(s.charAt(i), out); ... |
void | writeString(String str, ObjectOutputStream dos) DOC zhao Comment method "writeString". if (str == null) { dos.writeInt(-1); } else { byte[] byteArray = str.getBytes(UTF8); dos.writeInt(byteArray.length); dos.write(byteArray); |
void | writeString(String value, OutputStream os) Writes a the provided string in a Hessian string representation to the provided output stream using UTF-8 encoding. The string will be written with the following syntax: If the value is null, it will be written as
if (value == null) { os.write('N'); } else { int length = value.length(); int offset = 0; while (length > 0x8000) { int sublen = 0x8000; char tail = value.charAt(offset + sublen - 1); ... |
void | writeStringAsAsciiBytes(String in, OutputStream out) Writes the given String string as ASCII bytes (0-127) to the given OutputStream output stream . final int length = in.length(); for (int i = 0; i < length; i++) { out.write(in.charAt(i)); |
void | writeStringCompressed(ByteArrayOutputStream baos, String s) write String Compressed try { writeCompressedData(baos, s.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Cannot write string", e); |
void | writeStringKey(final Object key, final ObjectOutputStream oos) write String Key oos.writeObject(key); |
void | writeStringKey(final Object key, final ObjectOutputStream oos) write String Key oos.writeObject(key); |
void | writeStringMap(ObjectOutputStream out, Map write String Map out.writeInt(map.size());
for (String v : map.keySet()) {
out.writeUTF(v);
out.writeUTF(map.get(v));
|
void | writeStringSmart(ByteArrayOutputStream baos, String s, Map write String Smart if (s == null) { baos.write(STRING_NULL); return; if (knownStrings.get(s) != null) { baos.write(STRING_FROM_LIST); writeLength(baos, knownStrings.get(s)); return; ... |
void | writeStringStringMap(Map write String String Map if (map != null) { writeInt(os, map.size()); for (Map.Entry<String, String> entry : map.entrySet()) { writeString(os, entry.getKey()); writeString(os, entry.getValue()); } else { writeInt(os, 0); ... |