title: hasNext and findInLine in Scanner Class using array
body: <p>I'm new to Java, I have years experience in C, hope you can help me.</p>
  
  <p>I have a decimal file and I need to find a header and from there pick the data and again look for the header.
  Lets say my file looks like this:</p>
  
  <pre><code>480 124 125 001 047 001 047 001 480 001 001 001 001 001 001 001 001 001 001 001 001 047 001 480 002 002 002 002 002 002 002 002
  </code></pre>
  
  <p>my header is:</p>
  
  <pre><code>001 047 001 480
  </code></pre>
  
  <p>the header is stored at an int array called "header".</p>
  
  <p>I tried multiple ways-
  the code:</p>
  
  <pre><code>Integer i1 = new Integer(this.header[0]);
  Integer i2 = new Integer(this.header[1]);
  Integer i3 = new Integer(this.header[2]);
  Integer i4 = new Integer(this.header[3]);
  
  nextDec.hasNext(i1.toString() + i2.toString() + i3.toString() + i4.toString());
  </code></pre>
  
  <p>returns false, though I expect true.
  it returns false even if I delete the leading zeroes of the header numbers in the file (in reality I can't delete them)</p>
  
  <p>the code:</p>
  
  <pre><code>nextDec.findInLine(i1.toString() + " " + i2.toString() + " " + i3.toString() + " "
                  + i4.toString());
  </code></pre>
  
  <p>returns null, though I expect it to return the header.
  it returns the header if I delete the leading zeroes of the header numbers in the file why didn't it work with the hasNext method?</p>
  
  <p>The code:</p>
  
  <pre><code>nextDec.findInLine(Arrays.toString(header));
  </code></pre>
  
  <p>has no output whatsoever, why is that?
  how can I detect the header, with leading zeroes, retrieve the data and re-find it? is it possible to find the location (index) of where the header was found?</p>
  
  <p>thank you</p>
  
  <p>I'll try to be clearer. I have streaming data recorded on the PC using monitor software. the data is logged to a file in decimal form with leading zeroes (to have 3 digit numbers) and spaces between the numbers. the file contains multiple buffers.
  the data buffer starts with a 4 byte header, I need to find in the file the header and collect the data that follows it to the appropriate variables to be displayed in a graph. I was thinking of using the nextInt, nextFloat for that according to the type of data I want to read after the header is found.</p>
  
  <p>Thank you</p>