def load(file_object, *transformers, **kwargs):
    """
    Deserializes Java primitive data and objects serialized using
    ObjectOutputStream from a file-like object.

    :param file_object: A file-like object
    :param transformers: Custom transformers to use
    :param ignore_remaining_data: If True, don't log an error when unused
                                  trailing bytes are remaining
    :return: The deserialized object
    """
    # Read keyword argument
    ignore_remaining_data = kwargs.get("ignore_remaining_data", False)

    marshaller = JavaObjectUnmarshaller(
        file_object, kwargs.get("use_numpy_arrays", False)
    )

    # Add custom transformers first
    for transformer in transformers:
        marshaller.add_transformer(transformer)
    marshaller.add_transformer(DefaultObjectTransformer())

    # Read the file object
    return marshaller.readObject(ignore_remaining_data=ignore_remaining_data)
def load ( file_object , * transformers , ** kwargs ) : ignore_remaining_data = kwargs . get ( "ignore_remaining_data" , False ) marshaller = JavaObjectUnmarshaller ( file_object , kwargs . get ( "use_numpy_arrays" , False ) ) for transformer in transformers : marshaller . add_transformer ( transformer ) marshaller . add_transformer ( DefaultObjectTransformer ( ) ) return marshaller . readObject ( ignore_remaining_data = ignore_remaining_data )
Deserializes Java primitive data and objects serialized using
    ObjectOutputStream from a file-like object.

    :param file_object: A file-like object
    :param transformers: Custom transformers to use
    :param ignore_remaining_data: If True, don't log an error when unused
                                  trailing bytes are remaining
    :return: The deserialized object