Examples of toShortArray()


Examples of com.humaorie.dollar.ArrayWrapper.ByteArrayWrapper.toShortArray()

    @Test
    public void unboxByteArrayToShortArray() {
        Byte[] boxed = new Byte[]{42, 43, 44};
        ByteArrayWrapper arrayWrapper = new ByteArrayWrapper(boxed);
        Assert.assertArrayEquals(new short[]{42, 43, 44}, arrayWrapper.toShortArray());
    }

    @Test
    public void unboxByteArrayToIntArray() {
        Byte[] boxed = new Byte[]{42, 43, 44};
View Full Code Here

Examples of com.humaorie.dollar.ArrayWrapper.ShortArrayWrapper.toShortArray()

    @Test
    public void unboxShortArray() {
        final Short[] boxed = {42};
        final short[] unboxed = {42};
        final ShortArrayWrapper arrayWrapper = new ShortArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toShortArray());
    }

    @Test
    public void unboxShortArrayToIntArray() {
        final Short[] boxed = {42};
View Full Code Here

Examples of com.humaorie.dollar.ArrayWrapper.ShortArrayWrapper.toShortArray()

    @Test
    public void unboxShortArrayWithNulls() {
        final Short[] boxed = {null};
        final short[] unboxed = {0};
        final ShortArrayWrapper arrayWrapper = new ShortArrayWrapper(boxed);
        Assert.assertArrayEquals(unboxed, arrayWrapper.toShortArray());
    }

    @Test
    public void unboxIntegerArray() {
        final Integer[] boxed = {42};
View Full Code Here

Examples of com.jacob.com.SafeArray.toShortArray()

    SafeArray sha = new SafeArray(Variant.VariantShort, 4);
    System.out.println("elem size:" + sha.getElemSize());
    short shack[] = new short[] { 1000, 2000, 3000, 4000 };
    printArray(shack);
    sha.fromShortArray(shack);
    shack = sha.toShortArray();
    printArray(shack);

    short sh4[] = new short[4];
    sha.getShorts(0, 4, sh4, 0);
    printArray(sh4);
View Full Code Here

Examples of com.jacob.com.SafeArray.toShortArray()

    sha.getShorts(0, 4, sh4, 0);
    printArray(sh4);

    SafeArray sha2 = new SafeArray(Variant.VariantShort, 4);
    sha2.setShorts(0, 4, sh4, 0);
    shack = sha2.toShortArray();
    printArray(shack);

    // string
    System.out.println("String");
    SafeArray sa = new SafeArray(Variant.VariantString, 4);
View Full Code Here

Examples of com.jacob.com.SafeArray.toShortArray()

  public void testShortSafeArray() {
    short sourceData[] = new short[] { 1, 2, 3 };
    SafeArray saUnderTest = new SafeArray(Variant.VariantVariant, 3);

    saUnderTest.fromShortArray(sourceData);
    short[] extractedFromSafeArray = saUnderTest.toShortArray();
    for (int i = 0; i < extractedFromSafeArray.length; i++) {
      assertEquals("" + i, sourceData[i], extractedFromSafeArray[i]);
    }

    assertEquals("single get failed: ", sourceData[2], saUnderTest
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.