Java Byte Array Create toByteArray1D(int[][] d)

Here you can find the source of toByteArray1D(int[][] d)

Description

to Byte Array D

License

Open Source License

Declaration

public static byte[] toByteArray1D(int[][] d) 

Method Source Code

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

public class Main {
    public static byte[] toByteArray1D(int[][] d) {
        byte[] ret = new byte[d.length * d[0].length];
        int k = 0;
        for (int i = 0; i < d.length; i++) {
            for (int j = 0; j < d[0].length; j++) {
                ret[k++] = (byte) d[i][j];
            }//  w w w.  j  ava 2  s .  c  o m
        }
        return ret;
    }
}

Related

  1. toByteArray(String string)
  2. toByteArray(String strTransInfo)
  3. toByteArray(String uid)
  4. toByteArray(String value)
  5. toByteArray(String[] anArray)
  6. toByteArrayBE(byte b)
  7. toByteArrayForPBE(char[] chars)
  8. toByteArrayFromPositiveInts(int[] inInts)
  9. toByteArrayFromString(String value, int radix)