0

I have an application, which works with large files (gigabytes). Sometimes I get an outofmemoryerror exception. Does it help if I wrap InputStream in BufferedInputStream? What purpose of BufferedInputStream? How it works?

WelcomeTo
  • 19,843
  • 53
  • 170
  • 286

1 Answers1

2

No, it will not help you with memory consumption. It will help you speed up reading the file if you happen to read it in very small chunks.

What will help you, is not to keep the entire file in memory at once. Just keep the parts you're currently processing.

zmbq
  • 38,013
  • 14
  • 101
  • 171