public static byte[] insertIntInto( byte[] array, int index, int v ) { byte[] arrayToHoldInt = new byte[ 4 ]; intTo( arrayToHoldInt, 0, v ); return insert( array, index, arrayToHoldInt ); }
public static byte[] insertIntInto( byte[] array, int index, int v ) { byte[] arrayToHoldInt = new byte[ 4 ]; intTo( arrayToHoldInt, 0, v ); return insert( array, index, arrayToHoldInt ); }
public static byte[] insertFloatInto( byte[] array, int index, float value ) { byte[] holder = new byte[ 4 ]; floatTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertShortInto( byte[] array, int index, short value ) { byte[] holder = new byte[ 2 ]; shortTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertCharInto( byte[] array, int index, char value ) { byte[] holder = new byte[ 2 ]; charTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertCharInto( byte[] array, int index, char value ) { byte[] holder = new byte[ 2 ]; charTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertShortInto( byte[] array, int index, short value ) { byte[] holder = new byte[ 2 ]; shortTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertFloatInto( byte[] array, int index, float value ) { byte[] holder = new byte[ 4 ]; floatTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertCharInto( byte[] array, int index, char value ) { byte[] holder = new byte[ 2 ]; charTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertIntInto( byte[] array, int index, int v ) { byte[] arrayToHoldInt = new byte[ 4 ]; intTo( arrayToHoldInt, 0, v ); return insert( array, index, arrayToHoldInt ); }
public static byte[] insertShortInto( byte[] array, int index, short value ) { byte[] holder = new byte[ 2 ]; shortTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertFloatInto( byte[] array, int index, float value ) { byte[] holder = new byte[ 4 ]; floatTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertDoubleInto( byte[] array, int index, double value ) { Exceptions.requireNonNull( array ); byte[] holder = new byte[ 4 ]; doubleTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertDoubleInto( byte[] array, int index, double value ) { Exceptions.requireNonNull( array ); byte[] holder = new byte[ 4 ]; doubleTo( holder, 0, value ); return insert( array, index, holder ); }
public static byte[] insertDoubleInto( byte[] array, int index, double value ) { Exceptions.requireNonNull( array ); byte[] holder = new byte[ 4 ]; doubleTo( holder, 0, value ); return insert( array, index, holder ); }
@Test public void addInsertEdge() { assertArrayEquals( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'f', 'g' } ), insert( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'f' } ), 6, ( byte ) 'g' ) ); assertArrayEquals( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'f', 'g' } ), insert( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'f' } ), 7, ( byte ) 'g' ) ); }
@Test public void addInsertArray() { assertArrayEquals( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'f', 'g' } ), insert( array( new byte[]{ 'a', 'b', 'e', 'f', 'g' } ), 2, array( new byte[]{ 'c', 'd' } ) ) ); assertArrayEquals( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'f', 'g' } ), insert( array( new byte[]{ 'c', 'd', 'e', 'f', 'g' } ), 0, array( new byte[]{ 'a', 'b' } ) ) ); }
@Test public void addInsertArrayEnd() { assertArrayEquals( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i' } ), insert( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'h', 'i' } ), 5, array( new byte[]{ 'f', 'g' } ) ) ); }
@Test public void addInsertArrayEnd3() { assertArrayEquals( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'h', 'i', 'f', 'g' } ), insert( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'h', 'i' } ), 7, array( new byte[]{ 'f', 'g' } ) ) ); }
@Test public void addInsertArrayEnd2() { assertArrayEquals( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'h', 'f', 'g', 'i' } ), insert( array( new byte[]{ 'a', 'b', 'c', 'd', 'e', 'h', 'i' } ), 6, array( new byte[]{ 'f', 'g' } ) ) ); }