I am trying to convert comp3 and EBCIDIC characters in my java code but im running into out of memory exception as the amount of data handled is huge about 5 gb. my code is currently as follows:

```
byte[] data = Files.readAllBytes(path);

```

this is resulting in an out of memory exception which i can understand, but i cant use a file scanner as well since the data in the file wont be split into lines.

Can anyone point me in the correct direction on how to handle this

Note: the file may contain records of different length hence splitting it based on record length seams not possible.