8 Replies Latest reply on Apr 2, 2008 10:38 AM by 800323

    ArrayindexOutofbound in a datainputstream Read

      Hi all,

      I am getting an arraybounds exception when I call the following methods, the position value is 1 and the length value is 1, but when I do dis.read(carrier, position, length); I get an exception. dis is a datainputstream, any ideas?


           public static byte[] getByte(File searchable, int position, int length){
                byte[] carrier = new byte[length];
                try {
                     dis.read(carrier, position, length);
                } catch (IOException e) {
                return carrier;