private void writeString(String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); }
public void writeUTF(final String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); } }
public void flush() throws IOException { final int position = this.position; if (position == 0) { return; } final RiverMarshaller marshaller = riverMarshaller; if (position < 256) { marshaller.write(Protocol.ID_START_BLOCK_SMALL); marshaller.writeByte(position); } else if (position < 65536) { marshaller.write(Protocol.ID_START_BLOCK_MEDIUM); marshaller.writeShort(position); } else { marshaller.write(Protocol.ID_START_BLOCK_LARGE); marshaller.writeInt(position); } marshaller.write(buffer, 0, position); this.position = 0; }
public void write(final byte[] bytes, final int off, final int len) throws IOException { if (len < 1) { return; } final int bl = buffer.length; final int position = this.position; if (len > bl - position || len > bl >> 1) { flush(); if (len < 256) { riverMarshaller.write(Protocol.ID_START_BLOCK_SMALL); riverMarshaller.writeByte(len); riverMarshaller.write(bytes, off, len); } else if (len < 65536) { riverMarshaller.write(Protocol.ID_START_BLOCK_MEDIUM); riverMarshaller.writeShort(len); riverMarshaller.write(bytes, off, len); } else { riverMarshaller.write(Protocol.ID_START_BLOCK_LARGE); riverMarshaller.writeInt(len); riverMarshaller.write(bytes, off, len); } } else { System.arraycopy(bytes, off, buffer, position, len); this.position = position + len; } }
protected boolean writeKnownClass(final Class<?> objClass) throws IOException { final int configuredVersion = this.configuredVersion; int i = getBasicClasses(configuredVersion).get(objClass, -1); if (i != -1) { write(i); return true; } i = classCache.get(objClass, -1); if (i != -1) { final int diff = i - classSeq; if (diff >= -256) { write(ID_REPEAT_CLASS_NEAR); write(diff); } else if (diff >= -65536) { write(ID_REPEAT_CLASS_NEARISH); writeShort(diff); } else { write(ID_REPEAT_CLASS_FAR); writeInt(i); } return true; } return false; }
protected void writeNewProxyClass(final Class<?> objClass) throws IOException { ClassTable.Writer classTableWriter = classTable.getClassWriter(objClass); if (classTableWriter != null) { write(ID_PREDEFINED_PROXY_CLASS); classCache.put(objClass, classSeq++); writeClassTableData(objClass, classTableWriter); } else { write(ID_PROXY_CLASS); final String[] names = classResolver.getProxyInterfaces(objClass); writeInt(names.length); for (String name : names) { writeString(name); } classCache.put(objClass, classSeq++); if (configuredVersion == 1) { final BlockMarshaller blockMarshaller = getBlockMarshaller(); classResolver.annotateProxyClass(blockMarshaller, objClass); writeEndBlock(); } else { classResolver.annotateProxyClass(this, objClass); } } }
writeInt(0); break;
} else { write(ID_REPEAT_OBJECT_FAR); writeInt(rid); writeInt(((Integer) obj).intValue()); return; } else { write(ID_STRING_LARGE); writeInt(len); } else { write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE); writeInt(len); write(ID_PRIM_BYTE); write(bytes, 0, len); } else { write(unshared ? ID_ARRAY_LARGE_UNSHARED : ID_ARRAY_LARGE); writeInt(len); write(ID_PRIM_BOOLEAN); writeBooleanArray(booleans); writeInt(len); write(ID_PRIM_CHAR); for (int i = 0; i < len; i ++) { writeInt(len); write(ID_PRIM_SHORT);
final SerializableField[] fields = info.getFields(); final int cnt = fields.length; writeInt(cnt); for (int i = 0; i < cnt; i++) { SerializableField field = fields[i];
writeInt(serializableField.isAccessible() ? serializableField.getInt(obj) : 0); break;
public void writeUTF(final String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); } }
private void writeString(String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); }
private void writeString(String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); }
public void writeUTF(final String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); } }
public void writeUTF(final String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); } }
public void writeUTF(final String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); } }
public void writeUTF(final String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); } }
private void writeString(String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); }
private void writeString(String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); }
private void writeString(String string) throws IOException { writeInt(string.length()); shallowFlush(); UTFUtils.writeUTFBytes(byteOutput, string); }