code: private void updateSize(IoBuffer data) {
          this.widthInfo = data.getShort();
          this.heightInfo = data.getShort();
          // extract width and height of the frame
          this.width = this.widthInfo & 0xfff;
          this.height = this.heightInfo & 0xfff;
          // calculate size of blocks
          this.blockWidth = this.widthInfo & 0xf000;
          this.blockWidth = (this.blockWidth >> 12) + 1;
          this.blockWidth <<= 4;
  
          this.blockHeight = this.heightInfo & 0xf000;
          this.blockHeight = (this.blockHeight >> 12) + 1;
          this.blockHeight <<= 4;
  
          int xblocks = this.width / this.blockWidth;
          if ((this.width % this.blockWidth) != 0) {
              // partial block
              xblocks += 1;
          }
  
          int yblocks = this.height / this.blockHeight;
          if ((this.height % this.blockHeight) != 0) {
              // partial block
              yblocks += 1;
          }
  
          this.blockCount = xblocks * yblocks;
  
          int blockSize = maxCompressedSize(this.blockWidth * this.blockHeight * 3);
          int totalBlockSize = blockSize * this.blockCount;
          if (this.totalBlockDataSize != totalBlockSize) {
              log.info("Allocating memory for {} compressed blocks.", this.blockCount);
              this.blockDataSize = blockSize;
              this.totalBlockDataSize = totalBlockSize;
              this.blockData = new byte[blockSize * this.blockCount];
              this.blockSize = new int[blockSize * this.blockCount];
              // Reset the sizes to zero
              for (int idx = 0; idx < this.blockCount; idx++) {
                  this.blockSize[idx] = 0;
              }
          }
      }
docs: Update total block size
  
  @param data
  Byte buffer