Advertisement
Guest User

Untitled

a guest
Aug 4th, 2010
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  3973       public static byte[] copyOfRange(byte[] original, int start, int end) {
  2.  3974           if (start <= end) {
  3.  3975               if (original.length >= start && 0 <= start) {
  4.  3976                   int length = end - start;
  5.  3977                   int copyLength = Math.min(length, original.length - start);
  6.  3978                   byte[] copy = new byte[length];
  7.  3979                   System.arraycopy(original, start, copy, 0, copyLength);
  8.  3980                   return copy;
  9.  3981               }
  10.  3982               throw new ArrayIndexOutOfBoundsException();
  11.  3983           }
  12.  3984           throw new IllegalArgumentException();
  13.  3985       }
  14.  3986
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement