package com.rntensorflow.converter;

import com.facebook.react.bridge.ReadableNativeArray;
import com.facebook.react.bridge.WritableNativeArray;

public class ArrayConverter {

    public static String[] nativeArrayToStringArray(ReadableNativeArray nativeArray) {
        String[] arr = new String[nativeArray.size()];
        for (int i = 0; i < nativeArray.size(); i++) {
            arr[i] = nativeArray.getString(i);
        }

        return arr;
    }

    public static double[] nativeArrayToDoubleArray(ReadableNativeArray nativeArray) {
        double[] arr = new double[nativeArray.size()];
        for (int i = 0; i < nativeArray.size(); i++) {
            arr[i] = nativeArray.getDouble(i);
        }

        return arr;
    }

    public static ReadableNativeArray stringArrayToNativeArray(String[] arr) {
        WritableNativeArray nativeArray = new WritableNativeArray();
        for (int i = 0; i < arr.length; i++) {
            nativeArray.pushString(arr[i]);
        }

        return nativeArray;
    }

    public static ReadableNativeArray doubleArrayToNativeArray(double[] arr) {
        WritableNativeArray nativeArray = new WritableNativeArray();
        for (int i = 0; i < arr.length; i++) {
            nativeArray.pushDouble(arr[i]);
        }

        return nativeArray;
    }
}

@@ -726,32 +726,312 @@
 urn arr;%0A    %7D%0A%0A
+    public static long%5B%5D nativeArrayToLongArray(ReadableNativeArray nativeArray) %7B%0A        long%5B%5D arr = new long%5BnativeArray.size()%5D;%0A        for (int i = 0; i %3C nativeArray.size(); i++) %7B%0A            arr%5Bi%5D = (long)nativeArray.getDouble(i);%0A        %7D%0A%0A        return arr;%0A    %7D%0A%0A
     public stati
@@ -1541,32 +1541,313 @@
 i%5D);%0A        %7D%0A%0A
+        return nativeArray;%0A    %7D%0A%0A    public static ReadableNativeArray longArrayToNativeArray(long%5B%5D arr) %7B%0A        WritableNativeArray nativeArray = new WritableNativeArray();%0A        for (int i = 0; i %3C arr.length; i++) %7B%0A            nativeArray.pushDouble(arr%5Bi%5D);%0A        %7D%0A%0A
         return n

Add long converter