How would you split up binary data?

Hey, I’m trying to split up the binary data outputted from render.Capture(), so I can send it in multiple net messages, but I don’t know how I would split the binary data. Does anyone know how to do this? Here’s what I have at the moment:

[lua]
net.Receive(“start_screen_menu”, function()
local renderdata = {
[‘format’] = ‘jpeg’,
[‘quality’] = 20, // for the love of god don’t touch this
[‘h’] = ScrH(),
[‘w’] = ScrW(),
[‘x’] = 0,
[‘y’] = 0
}

local takepic = render.Capture( renderdata )

net.Start(“send_screen”)
net.WriteData(takepic, takepic:Length())
net.SendToServer()
end)
[/lua]

What I did was basically use string.sub and send multiple net messages.

[editline]12th May 2013[/editline]

Seems you’re writing the data, I just used WriteString and util.Base64Encode.

Ah, ok, I get it now.