/** * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive. * @param from the index of the first element (inclusive). * @param to the index of the last element (inclusive). * @return a new list * @exception IndexOutOfBoundsException index is out of range (<tt>size()>0 && (from<0 || from>to || to>=size())</tt>). */ public AbstractByteList partFromTo(int from, int to) { checkRangeFromTo(from, to, size); int length = to-from+1; ByteArrayList part = new ByteArrayList(length); part.addAllOfFromTo(this,from,to); return part; } /**
/** * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive. * @param from the index of the first element (inclusive). * @param to the index of the last element (inclusive). * @return a new list * @exception IndexOutOfBoundsException index is out of range (<tt>size()>0 && (from<0 || from>to || to>=size())</tt>). */ public AbstractByteList partFromTo(int from, int to) { checkRangeFromTo(from, to, size); int length = to-from+1; ByteArrayList part = new ByteArrayList(length); part.addAllOfFromTo(this,from,to); return part; } /**
/** * Returns a new list of the part of the receiver between <code>from</code>, * inclusive, and <code>to</code>, inclusive. * * @param from * the index of the first element (inclusive). * @param to * the index of the last element (inclusive). * @return a new list * @exception IndexOutOfBoundsException * index is out of range ( * <tt>size()>0 && (from<0 || from>to || to>=size())</tt> * ). */ public AbstractByteList partFromTo(int from, int to) { checkRangeFromTo(from, to, size); int length = to - from + 1; ByteArrayList part = new ByteArrayList(length); part.addAllOfFromTo(this, from, to); return part; }