Add support for variable read lengths