List of utility methods to do ByteBuffer Size
int | sizeOfValue(ByteBuffer bytes) size Of Value return 4 + (bytes == null ? 0 : bytes.remaining());
|
int | sizeP(ByteBuffer bb) size P return bb.remaining();
|
void | storeInt(ByteBuffer b, int fromIndex, int size, int value) store Int if (value == INVALID_INDEX) { b.put(fromIndex, INVALID); return; for (int i = 0; i < size; i++) { b.put(fromIndex + i, (byte) ((value >>> (8 * ((size - 1 - i)))) & 0xff)); |
void | tileImage(Graphics g, BufferedImage tileImage, int width, int height) Tiles an image as the background of a graphics object. int iw = tileImage.getWidth(); int ih = tileImage.getHeight(); if (iw > 0 && ih > 0) { for (int x = 0; x < width; x += iw) { for (int y = 0; y < height; y += ih) { g.drawImage(tileImage, x, y, iw, ih, null); |
boolean | xysizeIsWhite(BufferedImage img, int x, int y) xysize Is White try { int tab = 10; for (int i = x; i < x + tab; i++) { for (int j = y; j < y + tab; j++) { int col = img.getRGB(i, j); Color color = new Color(col); if (color.getRed() + color.getGreen() + color.getBlue() < 500) { return false; ... |