anchor.diff:  procedure TStandardMethodWriter.WriteTo(const AValue: TValue; const AMediaType: TMediaType;
     AOutputStream: TStream; const AActivation: IMARSActivation);
   var
  -  LStreamWriter: TStreamWriter;
     LResult: TJSONObject;
     LOutputParams: TJSONArray;
  -begin
  -  LStreamWriter := TStreamWriter.Create(AOutputStream);
  +  LJSONWriter: TJSONValueWriter;
  +begin
  +  LResult := TJSONObject.Create;
     try
  -    LResult := TJSONObject.Create;
  +    LResult.WriteTValue('result', AValue);
  +
  +    LOutputParams := nil;
  +    ForEachParameter(AActivation
  +      , procedure (AParameter: TRttiParameter; AParameterValue: TValue)
  +        var
  +          LOutputParamJSON: TJSONObject;
  +        begin
  +          LOutputParamJSON := TJSONObject.Create;
  +          try
  +            LOutputParamJSON.WriteTValue('name', AParameter.Name);
  +            LOutputParamJSON.WriteTValue('value', AParameterValue);
  +
  +            if not Assigned(LOutputParams) then
  +              LOutputParams := TJSONArray.Create;
  +            LOutputParams.Add(LOutputParamJSON);
  +          except
  +            LOutputParamJSON.Free;
  +            raise;
  +          end;
  +        end
  +      , function (AParameter: TRttiParameter): Boolean
  +        begin
  +          Result := ([pfOut, pfVar] * AParameter.Flags) <> []; // is a var or out argument
  +        end
  +    );
  +    if Assigned(LOutputParams) then
  +      LResult.AddPair('outputParams', LOutputParams);
  +
  +    LJSONWriter := TJSONValueWriter.Create;
       try
  -      LResult.WriteTValue('result', AValue);
  -
  -      LOutputParams := nil;
  -      ForEachParameter(AActivation
  -        , procedure (AParameter: TRttiParameter; AParameterValue: TValue)
  -          var
  -            LOutputParamJSON: TJSONObject;
  -          begin
  -            LOutputParamJSON := TJSONObject.Create;
  -            try
  -              LOutputParamJSON.WriteTValue('name', AParameter.Name);
  -              LOutputParamJSON.WriteTValue('value', AParameterValue);
  -
  -              if not Assigned(LOutputParams) then
  -                LOutputParams := TJSONArray.Create;
  -              LOutputParams.Add(LOutputParamJSON);
  -            except
  -              LOutputParamJSON.Free;
  -              raise;
  -            end;
  -          end
  -        , function (AParameter: TRttiParameter): Boolean
  -          begin
  -            Result := ([pfOut, pfVar] * AParameter.Flags) <> []; // is a var or out argument
  -          end
  -      );
  -      if Assigned(LOutputParams) then
  -        LResult.AddPair('outputParams', LOutputParams);
  -
  -      LStreamWriter.Write(LResult.ToJSON);
  +      LJSONWriter.WriteTo(LResult, AMediaType, AOutputStream, AActivation);
       finally
  -      LResult.Free;
  +      LJSONWriter.Free;
       end;
     finally
  -    LStreamWriter.Free;
  +    LResult.Free;
     end;
   end;
   
  
positive.code: var
    LStreamWriter: TStreamWriter;
    LJSONValue: TJSONValue;
  begin
    LStreamWriter := TStreamWriter.Create(AOutputStream);
    try
      LJSONValue := AValue.AsObject as TJSONValue;
      if Assigned(LJSONValue) then
        LStreamWriter.Write(LJSONValue.ToJSON);
    finally
      LStreamWriter.Free;
    end;
  
negative.code:   LIndex: Integer;
    LElement: TValue;
  begin
    if not AValue.IsArray then
      Exit;
  
    LJSONArray := TJSONArray.Create;
    try
      for LIndex := 0 to AValue.GetArrayLength -1 do
      begin
        LElement := AValue.GetArrayElement(LIndex);
  
        LJSONArray.AddElement(TJSONObject.RecordToJSON(LElement));
      end;
  
      LJSONWriter := TJSONValueWriter.Create;
      try
        LJSONWriter.WriteTo(LJSONArray, AMediaType, AOutputStream, AActivation);
      finally
        LJSONWriter.Free;
      end;
    finally
      LJSONArray.Free;
  