Refactoring LenghtPrefixed reader to bufferedReader