Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

infinite length of data

 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's what I want to do.. I want to be able to allow my users the possiblity of putting in a ton of data into my system. The datafields will be linked as such
FILEINDEX DATA NEXTLINK
1 This da 2
2 ta might 3
3 be many 4
4 charact 5
5 ers big. 6
6 As many 7
7 as 1000 -
This is a link list of data. I'm sure I can do it. I'm just not sure if anyone has done this already.. and if so. what things might I run into.
Regards,
Dale
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess the main thing is probably: resist the temptation to concatenate all the lines into one big String, unless you really, really have to. The details of processing will depend on what you're trying to do - but often you can "process as you go", reading n bytes or lines at a time, doing something with them, and writing the result to an output file, or database, or whatever, before reading the next n bytes or lines. Thus you never need to build up too much stuff in memory.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic