public static byte [ ] insert ( byte [ ] values , byte value , int index ) { byte [ ] nvalues = new byte [ values . length + 1 ] ; if ( index > 0 ) { System . arraycopy ( values , 0 , nvalues , 0 , index ) ; } nvalues [ index ] = value ; if ( index < values . length ) { System . arraycopy ( values , index , nvalues , index + 1 , values . length - index ) ; } return nvalues ; }
Creates a new array one larger than the supplied array and with the specified value inserted into the specified slot .