Java Object Array Convert To convertObjectArrayToByte(Object[] array)

Here you can find the source of convertObjectArrayToByte(Object[] array)

Description

Converts an object array to the primitive type

License

Open Source License

Parameter

Parameter Description
array The object array

Return

The primitive array

Declaration

public static byte[] convertObjectArrayToByte(Object[] array) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from   www  .j ava 2 s. c  o m
     * Converts an object array to the primitive type
     * @param array The object array
     * @return The primitive array
     */
    public static byte[] convertObjectArrayToByte(Object[] array) {
        byte[] primitives = new byte[array.length];
        for (int i = 0; i < array.length; i++)
            primitives[i] = (byte) (Byte) array[i];
        return primitives;
    }
}

Related

  1. convertObject(final Object obj, final Class clazz)
  2. convertObjectGUIToByteString(byte[] objectGUID)
  3. convertObjectToBean(Object obj, Class clazz)
  4. convertObjectToBoolean(Object value)
  5. convertObjectToInt(Object value)