def authenticate(conn, user, password)
      begin
        set_authenticate(user, password)
        conn.write(@data_buffer, @data_offset)
        conn.read(@data_buffer, HEADER_SIZE)

        result = @data_buffer.read(RESULT_CODE)
        raise Exceptions::Aerospike.new(result, "Authentication failed") if result != 0
      ensure
        Buffer.put(@data_buffer)
      end
    end
def authenticate(conn, user, password)
      begin
        set_authenticate(user, password)
        conn.write(@data_buffer, @data_offset)
        conn.read(@data_buffer, HEADER_SIZE)

        result = @data_buffer.read(RESULT_CODE)
        raise Exceptions::Aerospike.new(result, "Authentication failed") if result != 0
      ensure
        Buffer.put(@data_buffer)
      end
    end
:nodoc: