Quote: "I thought that, since the subimages.txt-file contains a single string of info without line breaks, the fileEOF would give a wrong number."
This may be down to what you are using to create the subimages file.
As a standard text file it works fine with line breaks - such as with font subimages;
32:0:0:41:85
33:41:0:32:85
34:73:0:38:85
35:111:0:42:85
36:153:0:42:85
37:195:0:63:85
38:258:0:55:85
39:313:0:29:85
40:342:0:36:85
41:378:0:36:85
42:414:0:37:85
43:451:0:42:85
44:493:0:30:85
45:523:0:33:85
46:556:0:30:85
etc.
I frequently use spare space in a font file for game graphics - either using subimages or directly using setSpriteAnimation/setSpriteFrame() or a little of both depending on placement.