If it's only a lookup of static data, I'd use Paul's approach and split the number up so that no one file needs to contain more entries than you can afford to read. For example you could take the first three digits as a directory name, the next three as a file name and then store the last two digits in numerical order in the file - finding whether a given number is present can then be done by opening the named file and reading through it until you find the target value or get to a number that is bigger than the target. That's just one way to split the values up - you would be best to choose a way that minimises the number of files and directories needed and the number of files in a directory and the number of numbers in a file.