1

I have a file coming from a network request, the file ends up being accessible as a BytesIO object, is there any way to split that BytesIO object into multiple BytesIO objects without the overhead of reading the content and manually splitting at a certain byte count?

To put it simply T want a function that does the following

def split_bytesio(input_file: BytesIO) -> List[BytesIO]:
    # return parts made using something that behaves like the JS Blob.slice() method
  • What are you trying to achieve by that? Have you tried using `seek` maybe? Can you show an example of what you expect to get as result? – mkrieger1 Apr 12 '22 at 19:09
  • I have to split a big file into small parts. I'm going to upload that file to a server, but it caps the maximum file size to 2GB... So I need to split larger files beforehand – Roberto Montalti Apr 12 '22 at 21:02
  • I'm starting to think about using a combination of copy, seek and truncate. I'll leave this question open in case someone has a better guess. – Roberto Montalti Apr 13 '22 at 06:58

0 Answers0