title: Convert in reverse ascii to whole decimal in Java
body: <p>Hi all and thank you for the help in advance.</p>
  
  <p>I have scoured the webs and have not really turned up with anything concrete as to my initial question.</p>
  
  <p>I have a program I am developing in JAVA thats primary purpose is to read a .DAT file and extract certain values from it and then calculate an output based on the extracted values which it then writes back to the file.</p>
  
  <p>The file is made up of records that are all the same length and format and thus it should be fairly straightforward to access, currently I am using a loop and and an if statement to find the first occurrence of a record and then through user input determine the length of each record to then loop through each record.</p>
  
  <p>HOWEVER! The first record of this file is a blank (Or so I thought). As it turns out this first record is the key to the rest of the file in that the first few chars are ascii and reference the record length and the number of records contained within the file respectively.</p>
  
  <p>below are a list of the ascii values themselves as found in the files (Disregard the " " the ascii is contained within them)</p>
  
  <p>"#¼ ä "</p>
  
  <p>"#g â "</p>
  
  <p>"ÇG @ "</p>
  
  <p>"Ç‰ ‰ "</p>
  
  <p>"Çò È "</p>
  
  <p>"=¼ "</p>
  
  <p>A friend of mine who many years ago use to code in Basic recons the first 3 chars refer to the record length and the following 9 refer to the number of records.</p>
  
  <p>Basically what I am needing to do is convert this initial string of ascii chars to two decimals in order to work out the length of each record and the number of records.</p>
  
  <p>Any assistance will be greatly appreciated.</p>
  
  <p>Edit...</p>
  
  <p>Please find below the Basic code used to access the file in the past, perhaps this will help?</p>
  
  <pre><code>    CLS
      INPUT "Survey System Data File? : ", survey$
      survey$ = "f:\apps\survey\" + survey$
      reclen = 3004
      OPEN survey$ + ".dat" FOR RANDOM AS 1 LEN = reclen
      FIELD #1, 3 AS RL$, 9 AS n$
      GET #1, 1
      RL = CVI(RL$): n = CVI(n$)
      PRINT "Record Length     = "; RL
      reclen = RL
      PRINT "Number of Records = "; n
      CLOSE #1
  </code></pre>
  
  <p>Basically what I am looking for is something similar but in java.</p>