I m trying to generate 4 billion instances of random characters ranging from A-H and then storing it all into a text file in Java. I tried the baseline method of iterating until a counter reaches to 4B but I find that it always results in a memory problem.
我很想知道,把这些信件作为借方而不是作为特征的原始价值储存起来是否更为有效。 例如:
A <- 000, B <- 001, C <- 010, D <- 011, E <- 100, F <- 101, G <- 110, H <- 111
If so, how would I go about doing this?
Looking ahead, once I have a text file with all these randomly generated letters, what would the best method be for opening the txt file to make further modifications? e.g. replacing or appending a few characters. I looked into Java s tutorials and think that the Random Access Files will do the trick, but is there a better option?
我是否应当增加一条新路线,说明每 n,使阅读的新线功能成为阻截点?
I guess to concisely state my questions, it s the following: How to generate 4Billion random limited letters (not all 26) effectively to a text file so that it can be also read and modified for future use?