docs: private void readOpBits(ImageInputStream pStream, boolean hasRegion) throws IOException {
          // Get rowBytes
          int rowBytesRaw = pStream.readUnsignedShort();
          int rowBytes = rowBytesRaw & 0x7FFF;
          boolean isPixMap = (rowBytesRaw & 0x8000) > 0;
          if (DEBUG) {
              System.out.print(hasRegion ? "bitsRgn" : "bitsRect");
              System.out.print(", rowBytes: " + rowBytes);
              if (isPixMap) {
                  System.out.print(", it is a PixMap");
              }
              else {
                  System.out.print(", it is a BitMap");
              }
          }
  
          // Get bounds rectangle. THIS IS NOT TO BE SCALED BY THE RESOLUTION!
          Rectangle bounds = new Rectangle();
          int y = pStream.readUnsignedShort();
          int x = pStream.readUnsignedShort();
          bounds.setLocation(x, y);
  
          y = pStream.readUnsignedShort();
          x = pStream.readUnsignedShort();
          bounds.setSize(x - bounds.x, y - bounds.y);
  
          ColorModel colorModel;
          int cmpSize;
  
          if (isPixMap) {
              // Get PixMap record version number
              int pmVersion = pStream.readUnsignedShort();
              if (DEBUG) {
                  System.out.print(", pmVersion: " + pmVersion);
              }
  
              // Get packing format
              int packType = pStream.readUnsignedShort();
              if (DEBUG) {
                  System.out.print(", packType: " + packType);
              }
  
              // Get size of packed data (not used for v2)
              int packSize = pStream.readInt();
              if (DEBUG) {
                  System.out.println(", packSize: " + packSize);
              }
  
              // Get resolution info
              double hRes = PICTUtil.readFixedPoint(pStream);
              double vRes = PICTUtil.readFixedPoint(pStream);
              if (DEBUG) {
                  System.out.print("hRes: " + hRes + ", vRes: " + vRes);
              }
  
              // Get pixel type
              int pixelType = pStream.readUnsignedShort();
              if (DEBUG) {
                  if (pixelType == 0) {
                      System.out.print(", indexed pixels");
                  }
                  else {
                      System.out.print(", RGBDirect");
                  }
              }
  
              // Get pixel size
              int pixelSize = pStream.readUnsignedShort();
              if (DEBUG) {
                  System.out.print(", pixelSize:" + pixelSize);
              }
  
              // Get pixel component count
              int cmpCount = pStream.readUnsignedShort();
              if (DEBUG) {
                  System.out.print(", cmpCount:" + cmpCount);
              }
  
              // Get pixel component size
              cmpSize = pStream.readUnsignedShort();
              if (DEBUG) {
                  System.out.print(", cmpSize:" + cmpSize);
              }
  
              // planeBytes (ignored)
              int planeBytes = pStream.readInt();
              if (DEBUG) {
                  System.out.print(", planeBytes:" + planeBytes);
              }
  
              // Handle to ColorTable record
              int clutId = pStream.readInt();
              if (DEBUG) {
                  System.out.print(", clutId:" + clutId);
              }
  
              // Reserved
              pStream.readInt();
  
              // Color table
              colorModel = PICTUtil.readColorTable(pStream, pixelSize);
          }
          else {
              // Old style BitMap record
              colorModel = QuickDraw.MONOCHROME;
              cmpSize = 1;
          }
  
          Rectangle srcRect = new Rectangle();
          readRectangle(pStream, srcRect);
  
          Rectangle dstRect = new Rectangle();
          readRectangle(pStream, dstRect);
  
          // Get transfer mode
          int mode = pStream.readUnsignedShort();
  
          Area region = hasRegion ? readRegion(pStream, new Rectangle()) : null;
  
          if (DEBUG) {
              System.out.print(", bounds: " + bounds);
              System.out.print(", srcRect: " + srcRect);
              System.out.print(", dstRect: " + dstRect);
              System.out.print(", mode: " + mode);
              System.out.print(hasRegion ? ", region: " + region : "");
              System.out.println();
          }
  
          byte[] data = new byte[rowBytes * bounds.height];
  
          // Read pixel data
          for (int i = 0; i < bounds.height; i++) {
              pStream.readFully(data, i * rowBytes, rowBytes);
          }
  
          DataBuffer db = new DataBufferByte(data, data.length);
          WritableRaster raster = Raster.createPackedRaster(db, (rowBytes * 8) / cmpSize, srcRect.height, cmpSize, null);
          BufferedImage image = new BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), null);
  
          // Draw pixel data
          srcRect.setLocation(0, 0); // Raster always start at 0,0
          context.copyBits(image, srcRect, dstRect, mode, region);
      }