• Post Reply Bookmark Topic Watch Topic
  • New Topic

io of JQPlus  RSS feed

 
Alan Chong
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I am trying to write a software which works like
JQPlus. As I know JQPlus put all the scjp questions in a file as a question database. I want to read the whole database to memory and show only one question at a time as JQPlus and
other scjp softwae do. I don't think I can mark
all offsets and lengths of all questions and use
subString() to put a question into a String object and finally use TextArea's setText() to show them in a TextArea. Because it requires me
to count the characters. Simple put,if the database has 100 , then it must be divided into
100 portions, and only one portion will be put into a TextArea at a time.
What Streams are the best to achieve that ?
Thanks for your attention.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm puzzled by what you are asking. You start by saying you want to put the questions in a database, but then seem to assume the questions are all crammed one-after-another in a single file ?
Which of these two choices are you looking for a solution to ? There are lots of other possibilities too:
  • One question per file in a known directory
  • One question per entry in a Properties file
  • Use some sort of separated file format (CSV, TSV, newline-separated, etc.)
  • Use some sort of XML file format
  • Use some sort of fixed-length file format (e.g. 1024 characters per question, padded with spaces or NULs)
  • Put the questions in a JNDI repository


  • And so on.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!