# Path: dtformats/decorators.py
# def deprecated(function):  # pylint: disable=invalid-name
#   def IssueDeprecationWarning(*args, **kwargs):
# 
# Path: dtformats/errors.py
# class ParseError(Exception):


import abc
import os
from dfdatetime import filetime as dfdatetime_filetime
from dfdatetime import posix_time as dfdatetime_posix_time
from dtfabric import errors as dtfabric_errors
from dtfabric.runtime import data_maps as dtfabric_data_maps
from dtfabric.runtime import fabric as dtfabric_fabric
from dtformats import decorators
from dtformats import errors
    Raises:
      ParseError: if the data cannot be read.
      ValueError: if the file-like object is missing.
    """
    if not file_object:
      raise ValueError('Missing file-like object.')

    file_object.seek(file_offset, os.SEEK_SET)

    read_error = ''

    try:
      data = file_object.read(data_size)
      read_count = len(data)

      if read_count != data_size:
        read_error = 'missing data (read: {0:d}, requested: {1:d})'.format(
            read_count, data_size)

    except IOError as exception:
      read_error = '{0!s}'.format(exception)

    if read_error:
      raise errors.ParseError((
          'Unable to read {0:s} data at offset: {1:d} (0x{1:08x}) with error: '
          '{2:s}').format(description, file_offset, read_error))

    return data

  # Deprecated in favor of _ReadStructureFromFileObject

# Path: dtformats/decorators.py
# def deprecated(function):  # pylint: disable=invalid-name
#   def IssueDeprecationWarning(*args, **kwargs):
# 
# Path: dtformats/errors.py
# class ParseError(Exception):


# Path: dtformats/data_format.py
import abc
import os
from dfdatetime import filetime as dfdatetime_filetime
from dfdatetime import posix_time as dfdatetime_posix_time
from dtfabric import errors as dtfabric_errors
from dtfabric.runtime import data_maps as dtfabric_data_maps
from dtfabric.runtime import fabric as dtfabric_fabric
from dtformats import decorators
from dtformats import errors

    Raises:
      ParseError: if the data cannot be read.
      ValueError: if the file-like object is missing.
    """
    if not file_object:
      raise ValueError('Missing file-like object.')

    file_object.seek(file_offset, os.SEEK_SET)

    read_error = ''

    try:
      data = file_object.read(data_size)
      read_count = len(data)

      if read_count != data_size:
        read_error = 'missing data (read: {0:d}, requested: {1:d})'.format(
            read_count, data_size)

    except IOError as exception:
      read_error = '{0!s}'.format(exception)

    if read_error:
      raise errors.ParseError((
          'Unable to read {0:s} data at offset: {1:d} (0x{1:08x}) with error: '
          '{2:s}').format(description, file_offset, read_error))

    return data

  # Deprecated in favor of _ReadStructureFromFileObject

  @decorators.deprecated