version 1.0
The problem with a scalar array Java templates don't support scalar types as generic parameters. Java code working with collection interfaces such as {@link List} or {@link Collection} is inapplicable for arrays. Some libraries supply methods to work with object array. These methods are generic and built-in types {@code int}, {@code boolean}, {@code long}, {@code short}, {@code byte}, {@code double}, {@code float} suffer.
The number of scalar type is small and finite. There are realization of Iterable, Iterator, Collection, and List interfaces for each scalar type. Also the library gives such useful methods as contains and indexOf for objects with Iterable interface only.
Yeah. There is some stupidness because all implementations differ between each other only types and this code has 100% implicit coupling and duplications. But Java has not left other way.
At least a user of the library should use only one class {@link org.dan.lastjcl.ScalUtils} to win this hell and to get rid of loops in his code when he works with scalar arrays.
System.out.println( StringUtils.join( ScalUtils.wrapCollection("hello world".getBytes()))); // cipher RandomAccessFile file = new RandomAccessFile("file.bin", "rw"); byte[] body = new byte[(int)file.length()]; file.read(body); Listlbody = ScalUtils.wrapList(body); Collections.shuffle(lbody); file.seek(0); file.write(body); file.close();