code: function Response(buffer, offset, size) {
      function readInt() {
          return (buffer[offset++]) |
                 (buffer[offset++] << 8) |
                 (buffer[offset++] << 16) |
                 (buffer[offset++] << 24)
      }
  
      offset = offset || 0
  
      var remaining = readInt()
      if (size && remaining != size) {
          throw new Error("Unexpected message size")
      }
      if (remaining > buffer.length - offset + 4) {
          throw new Error("Buffer is not large enough. Expected " +remaining+", have "+(buffer.length-offset+4))
      }
      if (remaining < 36) {
          throw new Error("Invalid message: "+remaining+" < 36 bytes")
      }
      this.requestId = readInt()
      this.responseTo = readInt()
      if (readInt() != OP_REPLY) {
          throw new Error("Message is not an OP_REPLY")
      }
      this.flags = readInt()
      this.cursor = new Long(readInt(), readInt())
      this.index = readInt()
      var documents = this.documents = []
      documents.length = readInt()
      remaining -= 36
      for (var i=0; i<documents.length; i++) {
          var docSize = readInt()
          if (docSize > remaining) {
              throw new Error("Invalid response, attempting to read "+docSize+" byte document with only "+remaining+" byte(s) remaining")
          }
          offset -= 4
          documents[i] = BSON.parse(buffer, offset)
          offset += docSize
          remaining -= docSize
      }
  }
docs: MsgHeader header;         // standard message header int32     responseFlags;  // bit vector - see details below int64     cursorID;       // cursor id if client needs to do get more's int32     startingFrom;   // where in the cursor this reply is starting int32     numberReturned; // number of documents in the reply document* documents;      // documents