public void decode(Routable obj, DocumentDeserializer buf) {
                GetDocumentReply reply = (GetDocumentReply)obj;

                Document doc = null;
                byte flag = buf.getByte(null);
                if (flag != 0) {
                    doc = Document.createDocument(buf);
                    reply.setDocument(doc);
                }
                long lastModified = buf.getLong(null);
                reply.setLastModified(lastModified);
                if (doc != null) {
                    doc.setLastModified(lastModified);
                }
            }
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