Beispiel #1
0
 internal static void printResource(Assembly assembly, string resource, string extension, Request request, Response response)
 {
     Stream stream = assembly.GetManifestResourceStream(resource);
     response.setContentType(Response.getMimeType(extension));
     BinaryReader reader = new BinaryReader(stream);
     byte[] bytes = new byte[stream.Length];
         int read;
         while ((read = reader.Read(bytes, 0, bytes.Length)) != 0)
         {
             response.print(bytes);
         }
         reader.Close();
 }