Why do you think the Java language chooses to treat file data as a stream rather than as a single object?

What kind of object do you think that could be? How big do you think it could be?

Java 7's NIO package includes a MappedByteBuffer class that maps the contents of the file to a logical array of bytes (or other primitive types) in memory, but you do have to deal with managing which parts are in memory at any given time when the file is large

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.