bytes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oll3i
    Contributor
    • Mar 2007
    • 679

    bytes

    i have declared byte array but when i try to read into the array 4 bytes from the offset 14 i get indexoutofbound sexception why ?
    byte[] bytesEOT = new byte[4];
    is.read(bytesEO T, 14, 4);
    Thank YOU
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by oll3i
    i have declared byte array but when i try to read into the array 4 bytes from the offset 14 i get indexoutofbound sexception why ?
    byte[] bytesEOT = new byte[4];
    is.read(bytesEO T, 14, 4);
    Thank YOU
    You want the InputStream to read four bytes and store them at positions 14, 15, 16 and 17
    in your byte array. Simply leave out both numbers and the InputStream will read
    at most four bytes and store them in your array. If you want to reposition your
    stream better use a RandomAccessFil e for that.

    kind regards,

    Jos

    Comment

    • oll3i
      Contributor
      • Mar 2007
      • 679

      #3
      sorry for bothering YOU i found the answer

      Comment

      Working...