class_docstr: A small helper class to read fields stored in JPEG2000 header boxes
  and to easily step into and read sub-boxes.
code: def next_box_type(self):
      # Skip the rest of the box if it has not been read
      if self.remaining_in_box > 0:
          self.fp.seek(self.remaining_in_box, os.SEEK_CUR)
      self.remaining_in_box = -1
  
      # Read the length and type of the next box
      lbox, tbox = self.read_fields(">I4s")
      if lbox == 1:
          lbox = self.read_fields(">Q")[0]
          hlen = 16
      else:
          hlen = 8
  
      if lbox < hlen or not self._can_read(lbox - hlen):
          msg = "Invalid header length"
          raise SyntaxError(msg)
  
      self.remaining_in_box = lbox - hlen
      return tbox
  
imports: from __future__ import annotations
  import io
  import os
  import struct
  from .None import Image, ImageFile, _binary
label_desc: Use image node_id 7 for calling the BoxReader obj's underlying member method code with example usage: obj.next_box_type() and returns: tbox