@SuppressWarnings("deprecation") public void write(DataOutput out) throws IOException { out.writeLong(rpcVersion); UTF8.writeString(out, declaringClassProtocolName); UTF8.writeString(out, methodName); out.writeLong(clientVersion); out.writeInt(clientMethodsHash); out.writeInt(parameterClasses.length); for (int i = 0; i < parameterClasses.length; i++) { ObjectWritable.writeObject(out, parameters[i], parameterClasses[i], conf, true); } }
public void write(DataOutput out) throws IOException { ObjectWritable.writeStringCached(out, methodName); out.writeInt(parameterClasses.length); for (int i = 0; i < parameterClasses.length; i++) { ObjectWritable.writeObject(out, parameters[i], parameterClasses[i], conf); } }
/** * {@inheritDoc} * * @see Writable#write(DataOutput) */ public void write(DataOutput out) throws IOException { BSONEncoder enc = new BSONEncoder(); BasicOutputBuffer buf = new BasicOutputBuffer(); enc.set(buf); enc.putObject(_doc); enc.done(); out.writeInt(buf.size()); // For better performance we can copy BasicOutputBuffer.pipe(OutputStream) // to have a method signature that works with DataOutput out.write(buf.toByteArray()); }