public boolean encode(Routable obj, DocumentSerializer out) {
            if (!(obj instanceof DocumentReply)) {
                throw new AssertionError(
                        "Document reply factory (" + getClass().getName() + ") registered for incompatible " +
                        "routable type " + obj.getType() + "(" + obj.getClass().getName() + ").");
            }
            DocumentReply reply = (DocumentReply)obj;
            out.putByte(null, (byte)(reply.getPriority().getValue()));
            return doEncode(reply, out);
        }
This method decodes a reply from the given byte buffer. You are guaranteed to only receive byte buffers
generated by a previous call to {@link #doEncode(DocumentReply, com.yahoo.document.serialization.DocumentSerializer)}.

<p>
This method is NOT exception safe. Return null to signal failure.

@param buf The byte buffer to read from.
@return The decoded reply.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/RoutableFactories60.java