title: Validation of A Byte Array
body: <p>I am trying to write a function in java that parses an array of bytes to determine if it follows a certain pattern. This pattern is as follows:</p>
  
  <ol>
  <li>The first two bytes in an array are 1 and 0</li>
  <li>The two bytes are followed by a random sequence of bytes terminated by a 0.</li>
  <li>This random sequence of bytes is followed by another random sequence of bytes also terminated by a 0.</li>
  <li>There are no bytes following this terminating 0.</li>
  </ol>
  
  <p>I am having trouble thinking of the logic of how to approach implementing such a function. </p>