Is there any mechanism in Java to reduce the memory usage while reading large text files?
Almost every program I've come across uses String to read text files.But Java reserves space for each String literal.That's why I think memory usage gets increased since all String objects are stored. All the classes of java.io deals with String. But if we're not using StringBuilder then how can we reduce memory usage?
After all reducing memory usage is the primary concern of StringBuilder[since it's not immutable like String]. Then how can we exploit its feature in Java I/O operation without using String i.e. without using something like this: sb.append([String object]);