From 8c7b6e251e2b92f809ab81e0a4e68d75cbe560c9 Mon Sep 17 00:00:00 2001 From: "samskivert@gmail.com" Date: Fri, 31 Jan 2003 02:27:48 +0000 Subject: [PATCH] Added ability to copy ourselves into another array at an offset. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1044 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/util/ArrayIntSet.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/ArrayIntSet.java b/projects/samskivert/src/java/com/samskivert/util/ArrayIntSet.java index 3f1be8ea..0419671e 100644 --- a/projects/samskivert/src/java/com/samskivert/util/ArrayIntSet.java +++ b/projects/samskivert/src/java/com/samskivert/util/ArrayIntSet.java @@ -1,5 +1,5 @@ // -// $Id: ArrayIntSet.java,v 1.10 2002/12/19 22:41:13 mdb Exp $ +// $Id: ArrayIntSet.java,v 1.11 2003/01/31 02:27:48 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -118,6 +118,19 @@ public class ArrayIntSet extends AbstractSet return values; } + /** + * Serializes this int set into an array at the specified offset. The + * array must be large enough to hold all the integers in our set at + * the offset specified. + * + * @return the array passed in. + */ + public int[] toIntArray (int[] target, int offset) + { + System.arraycopy(_values, 0, target, offset, _size); + return target; + } + // documentation inherited from interface public boolean add (Object o) {