code: private void drawPixels(Color color, long fileOffset, long length,
  			int additionalGap) {
  		assert color != null;
  		long pixelStart = getPixelNumber(fileOffset);
  		// necessary to avoid gaps due to rounding issues (you can't just do
  		// getPixelNumber(fileLength))
  		long pixelLength = getPixelNumber(fileOffset + length) - pixelStart;
  		long pixelMax = getXPixels() * getYPixels();
  		long pixelEnd = pixelStart + pixelLength;
  		if (pixelStart > pixelMax) {
  			logger.warn("too many pixels, max is: " + pixelMax
  					+ " and trying to set: " + pixelStart);
  		} else {
  			if (pixelEnd > pixelMax) {
  				logger.warn("too many pixels, max is: " + pixelMax
  						+ " and trying to set: " + pixelEnd);
  				pixelEnd = pixelMax;
  			}
  			for (long i = pixelStart; i < pixelEnd; i++) {
  				int x = (int) ((i % getXPixels()) * pixelSize);
  				int y = (int) ((i / getXPixels()) * pixelSize);
  				int gap = pixelated ? additionalGap + 1 : additionalGap;
  				int sizemodifier = pixelated ? 2 : 1;
  				drawRect(color, x + gap, y + gap, pixelSize - gap
  						* sizemodifier, pixelSize - gap * sizemodifier);
  			}
  		}
  		// Graphics g = image.getGraphics();
  		// g.drawString(new Long(fileOffset).toString(), (pixelStart % xPixels)
  		// * pixelSize,(pixelStart / xPixels) * pixelSize );
  	}
docs: Draws a square pixels at fileOffset with color. Height and width of the
  drawn area are based on the number of bytes that it represents given by
  the length.
  
  @param color
  of the square pixels
  @param fileOffset
  file location that the square pixels represent
  @param length
  number of bytes that are colored by the square pixels.
  @param additionalGap
  the gap between adjacent square pixels