code: @Override
      public void write(DataOutput out) throws IOException {
          out.writeInt(contentType.ordinal());
          if (content != null) {
              WritableUtils.writeVInt(out, content.length);
              out.write(content, 0, content.length);
          } else if (is != null) {
              content = new byte[MAX_BUFFER_SIZE];
              int len = 0;
              while ((len = is.read(content)) > 0) {
                  out.write(content, 0, len);
              }
          }      
      }
docs: /* (non-Javadoc)
  @see com.marklogic.mapreduce.MarkLogicDocument#write(java.io.DataOutput)