/// <summary>Print short string, to optimize dumping.</summary> /// <remarks>Print short string, to optimize dumping.</remarks> /// <hide></hide> public virtual void printShortString(java.io.PrintWriter pw) { pw.print("{alpha="); pw.print(mAlpha); pw.print(" matrix="); mMatrix.printShortString(pw); pw.print('}'); }
/// <summary>Print short representation to given writer.</summary> /// <remarks>Print short representation to given writer.</remarks> /// <hide></hide> public void printShortString(java.io.PrintWriter pw) { pw.print('['); pw.print(left); pw.print(','); pw.print(top); pw.print("]["); pw.print(right); pw.print(','); pw.print(bottom); pw.print(']'); }
/// <hide>Just for debugging; not internationalized.</hide> public static void formatDuration(long duration, java.io.PrintWriter pw, int fieldLen ) { lock (sFormatSync) { int len = formatDurationLocked(duration, fieldLen); pw.print(new string(sFormatStr, 0, len)); } }
/// <hide>Just for debugging; not internationalized.</hide> public static void formatDuration(long time, long now, java.io.PrintWriter pw) { if (time == 0) { pw.print("--"); return; } formatDuration(time - now, pw, 0); }
void sendFileUsingWriter(HttpServletResponse resp, string filename) { java.io.PrintWriter writer = resp.getWriter(); try { resp.setContentType(this.getServletContext().getMimeType(filename)); StreamReader fis = null; char[] buf = new char[4 * 1024]; // 4K buffer try { fis = new StreamReader(filename); int charsRead; while ((charsRead = fis.Read(buf, 0, buf.Length)) != -1 && charsRead != 0) { writer.write(buf, 0, charsRead); } } finally { if (fis != null) { fis.Close(); } } } catch (System.IO.FileNotFoundException e) { resp.setStatus(404, "Object Not Found."); HttpException myExp = new HttpException(404, "File '" + filename + "' not found."); writer.print(((HttpException)myExp).GetHtmlErrorMessage()); writer.flush(); } catch (Exception e) { Trace.WriteLine(String.Format("ERROR in Static File Reading {0},{1}", e.GetType(), e.Message)); resp.setStatus(500); HttpException myExp = new HttpException("Exception in Reading static file", e); writer.print(((HttpException)myExp).GetHtmlErrorMessage()); writer.flush(); } }