31 namespace OpenSim.Framework.Servers.HttpServer
33 public delegate
string BinaryMethod(byte[] data,
string path,
string param);
40 : this(httpMethod, path, binaryMethod, null, null) {}
43 : base(httpMethod, path, name, description)
45 m_method = binaryMethod;
50 byte[] data = ReadFully(request);
51 string param = GetParam(path);
52 string responseString = m_method(data, path, param);
54 return Encoding.UTF8.GetBytes(responseString);
57 private static byte[] ReadFully(Stream stream)
59 byte[] buffer =
new byte[1024];
60 using (MemoryStream ms =
new MemoryStream(1024*256))
64 int read = stream.Read(buffer, 0, buffer.Length);
71 ms.Write(buffer, 0, read);
override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
Base streamed request handler.
BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod, string name, string description)
delegate string BinaryMethod(byte[] data, string path, string param)
BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod)