<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def file_length(file_obj):
 """ Returns the length in bytes of a given file object. Necessary because os.fstat only works on real files and not file-like objects. This works on more types of streams, primarily StringIO. """

    file_obj.seek(0, 2)
    length = file_obj.tell()
    file_obj.seek(0)
    return length