question: private byte [ ] copyArray ( byte [ ] buffer , int length ) { byte [ ] result = new byte [ length ] ; System . arraycopy ( buffer , 0 , result , 0 , Math . min ( buffer . length , length ) ) ; return result ; }
target:  Implement java.util.Arrays.copyOf() for jdk 1.5.