# uproot.deserialization.numbytes_check

Defined in [uproot.deserialization](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/deserialization.py) on [line 156](https://github.com/scikit-hep/uproot5/blob/db953cf9827349b3d24eb6742404158c1dfd5481/src/uproot/deserialization.py#L156).

### uproot.deserialization.numbytes_check(chunk, start_cursor, stop_cursor, num_bytes, classname, context, file_path)

* **Parameters:**
  * **chunk** ([uproot.source.chunk.Chunk](uproot.source.chunk.Chunk.html.md)) – Buffer of contiguous data
    from the file [uproot.source.chunk.Source](uproot.source.chunk.Source.html.md).
  * **start_cursor** ([uproot.Cursor](uproot.source.cursor.Cursor.html.md)) – Initial position in
    that `chunk`.
  * **stop_cursor** ([uproot.Cursor](uproot.source.cursor.Cursor.html.md)) – Current position in
    that `chunk`.
  * **num_bytes** (*int* *or* *None*) – If an integer, the number of bytes to compare
    with the difference between `start_cursor` and `stop_cursor`;
    if None, this function does nothing.
  * **classname** (*str*) – C++ (decoded) name of the class for error messages.
  * **context** (*dict*) – Auxiliary data used in deserialization.
  * **file_path** (*str*) – Name of the file for error messages.

Verifies that the number of bytes matches the change in position of the
cursor (if `num_bytes` is not None).

Raises a [uproot.DeserializationError](uproot.deserialization.DeserializationError.html.md) on failure.
