@Override public void writeData(ObjectDataOutput out) throws IOException { out.writeByteArray(value); out.writeByteArray(contentType); }
@Override public void writeData(ObjectDataOutput out) throws IOException { out.writeByteArray(value); out.writeByteArray(contentType); }
@Override public void writeContent(DataOutput out, Map<String, byte[]> content) throws IOException { out.writeInt(content.size()); for (Map.Entry<String, byte[]> e: content.entrySet()) { out.writeUTF(e.getKey()); ((ObjectDataOutput) out).writeByteArray(e.getValue()); } }
@Override public void writeData(ObjectDataOutput out) throws IOException { out.writeByteArray(mainClassDefinition); out.writeInt(innerClassDefinitions.size()); for (Map.Entry<String, byte[]> entry : innerClassDefinitions.entrySet()) { out.writeUTF(entry.getKey()); out.writeByteArray(entry.getValue()); } }
@Override public void writeData(ObjectDataOutput out) throws IOException { out.writeInt(p); out.writeByteArray(register); }
@SuppressWarnings("unchecked") @Override public void write(ObjectDataOutput out, Object object) throws IOException { byte[] bytes = serializer.write(object); out.writeByteArray(bytes); }
@Override public void writeData(ObjectDataOutput out) throws IOException { out.writeInt(p); out.writeByteArray(register); }
@Override public void writeData(ObjectDataOutput out) throws IOException { out.writeByteArray(mainClassDefinition); out.writeInt(innerClassDefinitions.size()); for (Map.Entry<String, byte[]> entry : innerClassDefinitions.entrySet()) { out.writeUTF(entry.getKey()); out.writeByteArray(entry.getValue()); } }
@SuppressWarnings("unchecked") @Override public void write(ObjectDataOutput out, Object object) throws IOException { byte[] bytes = serializer.write(object); out.writeByteArray(bytes); }
@Override public void write(ObjectDataOutput out, PersonProtos.Person person) throws IOException { out.writeByteArray(person.toByteArray()); }
@Override protected void writeInternal(ObjectDataOutput out) throws IOException { out.writeInt(classDefinitions.size()); for (Map.Entry<String, byte[]> classDefinition : classDefinitions) { out.writeUTF(classDefinition.getKey()); out.writeByteArray(classDefinition.getValue()); } }
@Override protected void writeInternal(ObjectDataOutput out) throws IOException { out.writeInt(classDefinitions.size()); for (Map.Entry<String, byte[]> classDefinition : classDefinitions) { out.writeUTF(classDefinition.getKey()); out.writeByteArray(classDefinition.getValue()); } }
@Override public void writeData(ObjectDataOutput out) throws IOException { mergeAndResetTmp(); out.writeInt(p); out.writeInt(register.total); out.writeInt(register.mark); out.writeInt(register.prev); out.writeByteArray(register.elements); }
@Override public void writeData(ObjectDataOutput out) throws IOException { mergeAndResetTmp(); out.writeInt(p); out.writeInt(register.total); out.writeInt(register.mark); out.writeInt(register.prev); out.writeByteArray(register.elements); }
public static void writeCompressedContent(ObjectDataOutput out, ContentSerializer<Object> cs, Object data) throws IOException { InternalSerializationService ss = (InternalSerializationService) out.getSerializationService(); ObjectDataOutput tmp = ss.createObjectDataOutput(); cs.writeContent(tmp, data); out.writeByteArray(IOUtil.compress(tmp.toByteArray())); } }
public static void writeCompressedData(ObjectDataOutput out, Object data) throws IOException { InternalSerializationService ss = (InternalSerializationService) out.getSerializationService(); ObjectDataOutput tmp = ss.createObjectDataOutput(); tmp.writeObject(data); out.writeByteArray(IOUtil.compress(tmp.toByteArray())); }
@Override public void writeData(ObjectDataOutput out) throws IOException { InternalSerializationService ss = (InternalSerializationService) out.getSerializationService(); ObjectDataOutput tmp = ss.createObjectDataOutput(); super.writeData(tmp); out.writeByteArray(IOUtil.compress(tmp.toByteArray())); }
@Override public void writeData(ObjectDataOutput out) throws IOException { int sz = size(); out.writeInt(sz); if (sz > 0) { InternalSerializationService ss = (InternalSerializationService) out.getSerializationService(); ObjectDataOutput tmp = ss.createObjectDataOutput(); writeResults(tmp); byte[] data = tmp.toByteArray(); //logger.trace("writeData; original size: {}; ", data.length); // it hangs here if number of docs in the cursor = 0 (data.length = 4); byte[] data2 = IOUtil.compress(data); //logger.trace("writeData; original size: {}; compressed size: {}", data.length, data2.length); out.writeByteArray(data2); } }
@Override public void write(ObjectDataOutput out, SessionData data) throws IOException { out.writeUTF(data.getId()); out.writeUTF(data.getContextPath()); out.writeUTF(data.getVhost()); out.writeLong(data.getAccessed()); out.writeLong(data.getLastAccessed()); out.writeLong(data.getCreated()); out.writeLong(data.getCookieSet()); out.writeUTF(data.getLastNode()); out.writeLong(data.getExpiry()); out.writeLong(data.getMaxInactiveMs()); try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos)) { SessionData.serializeAttributes(data, oos); out.writeByteArray(baos.toByteArray()); } }