added support for partially length prefixed streams