private static void CopyStream(InputStream source, OutputStream destination) { sbyte[] b = new sbyte[0x1f40]; Label_000B: try { int count = source.read(b, 0, b.Length); if (count > 0) { destination.write(b, 0, count); goto Label_000B; } } catch (Exception exception) { string message = exception.Message; goto Label_000B; } }
public /*synchronized*/ void writeTo(OutputStream @out) { @out.write(buf, 0, count); }
public virtual void encode(BufferedImage bufferedImage, OutputStream outputStream) { if (bufferedImage == null) { string str = "Null 'image' argument."; Throwable.__\u003CsuppressFillInStackTrace\u003E(); throw new IllegalArgumentException(str); } else if (outputStream == null) { string str = "Null 'outputStream' argument."; Throwable.__\u003CsuppressFillInStackTrace\u003E(); throw new IllegalArgumentException(str); } else { PngEncoder.__\u003Cclinit\u003E(); PngEncoder pngEncoder = new PngEncoder((Image) bufferedImage, this.encodingAlpha, 0, this.quality); outputStream.write(pngEncoder.pngEncode()); } }
public virtual void copyStreams(InputStream @in, OutputStream @out, int buffersize) { byte[] numArray = new byte[buffersize]; for (int index = @in.read(numArray); index > -1; index = @in.read(numArray)) @out.write(numArray, 0, index); }
public /*synchronized*/ void write(int b) { @out.write(b); incCount(1); }
public static void writeScaledChartAsPNG(OutputStream @out, JFreeChart chart, int width, int height, int widthScaleFactor, int heightScaleFactor) { if (@out == null) { string str = "Null 'out' argument."; Throwable.__\u003CsuppressFillInStackTrace\u003E(); throw new IllegalArgumentException(str); } else if (chart == null) { string str = "Null 'chart' argument."; Throwable.__\u003CsuppressFillInStackTrace\u003E(); throw new IllegalArgumentException(str); } else { double num1 = (double) (width * widthScaleFactor); double num2 = (double) (height * heightScaleFactor); double num3 = (double) width; double num4 = (double) height; int num5 = 0; if (widthScaleFactor != 1 || heightScaleFactor != 1) num5 = 1; double num6 = num1 / num3; double num7 = num2 / num4; BufferedImage image = new BufferedImage(ByteCodeHelper.d2i(num1), ByteCodeHelper.d2i(num2), 2); Graphics2D graphics = image.createGraphics(); if (num5 != 0) { AffineTransform transform = graphics.getTransform(); graphics.transform(AffineTransform.getScaleInstance(num6, num7)); chart.draw(graphics, (Rectangle2D) new Rectangle2D.Double(0.0, 0.0, num3, num4), (Point2D) null, (ChartRenderingInfo) null); graphics.setTransform(transform); ((Graphics) graphics).dispose(); } else chart.draw(graphics, (Rectangle2D) new Rectangle2D.Double(0.0, 0.0, num3, num4), (Point2D) null, (ChartRenderingInfo) null); @out.write(ChartUtilities.encodeAsPNG(image)); } }
/*synchronized*/ public void writeTo(OutputStream @out) { @out.write(buf, 0, count); }