added support for indefinite length format