added some additional functions for dealing with chunks - needed for mitmproxy streaming capability