source: binary-improvements/MapRendering/LegacyApiHelper.cs@ 454

Last change on this file since 454 was 454, checked in by alloc, 16 months ago

24_29_43
Switched over to vanilla Web infrastructure

File size: 691 bytes
RevLine 
[454]1using System.Net;
2using System.Text;
3using AllocsFixes.JSON;
4using Webserver;
5using HttpListenerResponse = SpaceWizards.HttpListener.HttpListenerResponse;
6
7namespace AllocsFixes {
8 public static class LegacyApiHelper {
9 public static void WriteJSON (HttpListenerResponse _resp, JSONNode _root) {
10#if ENABLE_PROFILER
11 jsonSerializeSampler.Begin ();
12#endif
13 StringBuilder sb = new StringBuilder ();
14 _root.ToString (sb);
15#if ENABLE_PROFILER
16 jsonSerializeSampler.End ();
17 netWriteSampler.Begin ();
18#endif
19 WebUtils.WriteText (_resp, sb.ToString(), HttpStatusCode.OK, WebUtils.MimeJson);
20
21#if ENABLE_PROFILER
22 netWriteSampler.End ();
23#endif
24 }
25
26 }
27}
Note: See TracBrowser for help on using the repository browser.