Method that is called to write screenshot. This method is responsible to check the size of image.

@param screenshotEntry screenshot entry to write
@throws IOException
967453
protected void writeScreenshot(ScreenshotEntry screenshotEntry) throws IOException {

        int heigth = screenshotEntry.getHeight() * Integer.parseInt(this.configuration.getImageHeight()) / 100;
        int width = screenshotEntry.getWidth() * Integer.parseInt(this.configuration.getImageWidth()) / 100;

        boolean large = width > Integer.parseInt(this.configuration.getMaxImageWidth());

        if (large) {

            writer.append(".").append(screenshotEntry.getPhase().name()).append(NEW_LINE);
            writer.append(screenshotEntry.getLink()).append(" -> file://").append(screenshotEntry.getPath()).append("[")
            .append(this.resourceBundle.getString("asciidoc.reporter.screenshot"))
            .append("]").append(NEW_LINE).append(NEW_LINE);

        } else {

            writer.append(".").append(screenshotEntry.getPhase().name()).append(NEW_LINE);
            writer.append("image::").append(screenshotEntry.getLink())
                .append("[screenshot," + width + "," + heigth + "]")
                .append(NEW_LINE).append(NEW_LINE);
        }

    }
10675
public static boolean write(Image image, String imageType, ImageOutputStream destImageStream, float quality) throws IORuntimeException {
		if (StrUtil.isBlank(imageType)) {
			imageType = IMAGE_TYPE_JPG;
		}

		final ImageWriter writer = getWriter(image, imageType);
		return write(toBufferedImage(image, imageType), writer, destImageStream, quality);
	}
109912
public static void writePng(Image image, OutputStream out) throws IORuntimeException {
		write(image, IMAGE_TYPE_PNG, out);
	}
521714
protected void closeCurrentEntry() throws IOException {
        if (currentEntry != null) {
            if (currentEntry.getSize() > currentFileSize) {
                throw new IOException( "The current entry[" + currentEntry.getName() + "] of size["
                        + currentEntry.getSize() + "] has not been fully written." );
            }

            currentEntry = null;
            currentFileSize = 0;

            pad();
        }
    }
1295434
public static void write (BufferedImage image, OutputStream out)
        throws IOException
    {
        DataOutputStream dout = new DataOutputStream(out);

        // write the image dimensions
        int width = image.getWidth(), height = image.getHeight();
        dout.writeInt(width);
        dout.writeInt(height);

        // write the color model information
        IndexColorModel cmodel = (IndexColorModel)image.getColorModel();
        int tpixel = cmodel.getTransparentPixel();
        dout.writeInt(tpixel);
        int msize = cmodel.getMapSize();
        int[] map = new int[msize];
        cmodel.getRGBs(map);
        dout.writeInt(msize);
        for (int element : map) {
            dout.writeInt(element);
        }

        // write the raster data
        DataBufferByte dbuf = (DataBufferByte)image.getRaster().getDataBuffer();
        byte[] data = dbuf.getData();
        if (data.length != width * height) {
            String errmsg = "Raster data not same size as image! [" +
                width + "x" + height + " != " + data.length + "]";
            throw new IllegalStateException(errmsg);
        }
        dout.write(data);
        dout.flush();
    }
1053510
protected void writeEntry(final GZIPArchive.Entry entry) throws IOException {

		// ID1 ID2 CM FLG

		this.output.write(GZIPArchive.GZIP_START);

		// MTIME

		writeLEInt(this.output, entry.mtime);

		// XFL OS

		this.output.write(GZIPArchive.XFL_OS);

		/* EXTRA begin */

		// XLEN

		writeLEShort(this.output, GZIPArchive.XLEN);

		// SI1 SI2 (as in warc spec)

		this.output.write(GZIPArchive.SKIP_LEN);

		// LEN

		writeLEShort(this.output, GZIPArchive.SUB_LEN);

		// compressed-skip-length (as in warc spec)

		writeLEInt(this.output, entry.compressedSkipLength);

		// uncompressed length (as in warc spec)

		writeLEInt(this.output, entry.uncompressedSkipLength);

		/* EXTRA end */

		// NAME

		this.output.write(entry.name);
		this.output.write(0);

		// COMMENT

		this.output.write(entry.comment);
		this.output.write(0);

		// compressed blocks

		this.output.write(deflaterStream.array, 0, deflaterStream.length);

		// CRC32

		writeLEInt(this.output, entry.crc32);

		// ISIZE

		writeLEInt(this.output, entry.uncompressedSkipLength);

	}
889199
void write(Writer out)
         throws IOException
    {
        out.write("<frame scrolling=\""+scrolling+"\""+resize+border);
        
        if(src!=null)
            out.write(" src=\""+src+"\"");
        if(name!=null)
            out.write(" name=\""+name+"\"");
        out.write(">");
    }
626007
private void putEntry(String key, CacheHeader entry) {
        if (!mEntries.containsKey(key)) {
            mTotalSize += entry.size;
        } else {
            CacheHeader oldEntry = mEntries.get(key);
            mTotalSize += (entry.size - oldEntry.size);
        }
        mEntries.put(key, entry);
    }
1119840
public void write(int bits, int width) throws IOException {
        if (bits == 0 && width == 0) {
            return;
        }
        if (width <= 0 || width > 32) {
            throw new IOException("Bad write width.");
        }
        while (width > 0) {
            int actual = width;
            if (actual > this.vacant) {
                actual = this.vacant;
            }
            this.unwritten |= ((bits >>> (width - actual)) &
                    ((1 << actual) - 1)) << (this.vacant - actual);
            width -= actual;
            nrBits += actual;
            this.vacant -= actual;
            if (this.vacant == 0) {
                this.out.write(this.unwritten);
                this.unwritten = 0;
                this.vacant = 8;
            }
        }
    }
250692
@Override
  public void writeInt(int n) throws IOException {
    byte[] intBytes = new byte[] { (byte) ((n >>> 24) ^ 0x80),
        (byte) (n >>> 16), (byte) (n >>> 8), (byte) n };
    out.write(intBytes);
  }
506892
public void writeTiff() {
		if (directory.getWriteRasters() != null) {
			TIFFImage tiffImage = new TIFFImage();
			tiffImage.add(directory);
			try {
				imageBytes = TiffWriter.writeTiffToBytes(tiffImage);
			} catch (IOException e) {
				throw new GeoPackageException("Failed to write TIFF image", e);
			}
		}
	}
203486
public void printScreenFieldData(ScreenComponent sField, PrintWriter out, int iPrintOptions)
    {
        ((ScreenField)sField).printData(out, iPrintOptions);
    }
331494
public static void captureScreen(final File file) {
		Rectangle rectangle = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
		captureScreenRect(file, rectangle);
	}
702962
public void writeEntry(LogEntry logEntry, int caseNumber) throws PerspectiveException, IOException{
		if(logPerspective == LogPerspective.TRACE_PERSPECTIVE)
			throw new PerspectiveException(PerspectiveError.WRITE_ACTIVITY_IN_TRACE_PERSPECTIVE);
		
		prepare();
		if(!headerWritten){
			write(logFormat.getFileHeader());
			headerWritten = true;
		}
		output.write(logFormat.getEntryAsString(logEntry, caseNumber));
	}
755187
def add_screenshot(self, screenshot):
        
        if screenshot in self.screenshots:
            return
        self.screenshots.append(screenshot)
1163536
public void save() {
        File screenshotFile = new File(location.toString(), fileName);
        if(!Files.exists(location)) {
            screenshotFile.mkdirs();
        }
        if (title != null && !title.isEmpty()) {
            image = ImageProcessor.addTitle(image, title, Color.red, new Font("Serif", Font.BOLD, 20));
        }
        FileUtil.writeImage(image, EXTENSION, screenshotFile);
    }
1097896
@Override
    public void write(int b) throws IOException {
        Exceptions.checkNotClosed(this.closed, this);
        Preconditions.checkState(this.currentFrame != null, "No current frame exists. Most likely no record is started.");

        int attemptCount = 0;
        int totalBytesWritten = 0;
        while (totalBytesWritten == 0 && attemptCount < 2) {
            // We attempt to write 1 byte. If append() says it wrote 0 bytes, it means the current frame is full. Seal it and create a new one.
            totalBytesWritten += this.currentFrame.append((byte) b);
            if (totalBytesWritten == 0) {
                this.currentFrame.endEntry(false); // Close the current entry, and indicate it is not the last one of the record.
                flush();
                createNewFrame();
                startNewRecordInCurrentFrame(false);
            }

            attemptCount++;
        }

        if (totalBytesWritten == 0) {
            throw new SerializationException("Unable to make progress in serializing to DataFrame.");
        }
    }