code: def from_file(cls: Type[D], file: BinaryIO, **kwargs: Any) -> D:
      encoded_data = cls(
          fromfile(file, dtype=torch.uint8, byte_order=sys.byteorder),
          **kwargs,
      )
      file.close()
      return encoded_data
  
file_path: vision/torchvision/prototype/datasets/utils/_encoded.py
imports: from __future__ import annotations
  import os
  import sys
  from typing import Any, BinaryIO, Optional, Tuple, Type, TypeVar, Union
  import PIL.Image
  import torch
  from torchvision.prototype.utils._internal import fromfile, ReadOnlyTensorBuffer
  from torchvision.tv_tensors._tv_tensor import TVTensor
label_desc: Use image node_id 4 for calling the EncodedData obj's underlying member method code with example usage: obj.from_file(cls, file) and returns: encoded_data