Ooops. I pasted in a byte[] copier. You can use reflection to
construct the same type of Object array that was passed in.. eg. You
pass in String[], you get a String[] back...
public static Object[] expandArray(Object[] source) {
Object[] result = (Object[])
Array.newInstance(source.getClass().getComponentType(),
source.length == 0 ? 1 : source.length * 2);
System.arraycopy(source, 0, result, 0, sourceLen.length);
return result;
}
String[] newone = (String[])expandArray( original );
I've got a whole bunch-o-stuff here..
http://code.google.com/p/catchpole/source/browse/trunk/src/java/net/catchpole/io/Arrays.java
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---