Something like.. ource.length == 0 ? 1 makes sure it turns a zero
length array into one. else it will never expand
public static byte[] expandArray(byte[] source) {
byte[] result = new byte[source.length == 0 ? 1 :
source.length * 2];
System.arraycopy(source, 0, result, 0, sourceLen.length);
return result;
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---