Java Utililty Methods ByteBuffer Size

List of utility methods to do ByteBuffer Size

Description

The list of methods to do ByteBuffer Size are organized into topic(s).

Method

intsizeOfValue(ByteBuffer bytes)
size Of Value
return 4 + (bytes == null ? 0 : bytes.remaining());
intsizeP(ByteBuffer bb)
size P
return bb.remaining();
voidstoreInt(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));
voidtileImage(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);
booleanxysizeIsWhite(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;
...