title: Splitting a Byte array
body: <p>Is it possible to get specific bytes from a byte array in java? </p>
  
  <p>I have a byte array:  </p>
  
  <pre><code>byte[] abc = new byte[512]; 
  </code></pre>
  
  <p>and i want to have 3 different byte arrays from this array.</p>
  
  <ol>
  <li>byte 0-127</li>
  <li>byte 128-255  </li>
  <li>byte256-511. </li>
  </ol>
  
  <p>I tried <code>abc.read(byte[], offset,length)</code> but it works only if I give offset as 0, for any other value it throws an <code>IndexOutOfbounds</code> exception.</p>
  
  <p>What am I doing wrong?</p>