package com.rntensorflow.converter;

import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableNativeArray;

public class ArrayConverter {

    public static String[] readableArrayToStringArray(ReadableArray readableArray) {
        String[] arr = new String[readableArray.size()];
        for (int i = 0; i < readableArray.size(); i++) {
            arr[i] = readableArray.getString(i);
        }

        return arr;
    }

    public static double[] readableArrayToDoubleArray(ReadableArray readableArray) {
        double[] arr = new double[readableArray.size()];
        for (int i = 0; i < readableArray.size(); i++) {
            arr[i] = readableArray.getDouble(i);
        }

        return arr;
    }

    public static long[] readableArrayToLongArray(ReadableArray readableArray) {
        long[] arr = new long[readableArray.size()];
        for (int i = 0; i < readableArray.size(); i++) {
            arr[i] = (long)readableArray.getDouble(i);
        }

        return arr;
    }

    public static ReadableArray stringArrayToReadableArray(String[] arr) {
        WritableArray writableArray = new WritableNativeArray();
        for (int i = 0; i < arr.length; i++) {
            writableArray.pushString(arr[i]);
        }

        return writableArray;
    }

    public static ReadableArray doubleArrayToReadableArray(double[] arr) {
        WritableArray writableArray = new WritableNativeArray();
        for (int i = 0; i < arr.length; i++) {
            writableArray.pushDouble(arr[i]);
        }

        return writableArray;
    }

    public static ReadableArray longArrayToReadableArray(long[] arr) {
        WritableArray writableArray = new WritableNativeArray();
        for (int i = 0; i < arr.length; i++) {
            writableArray.pushDouble(arr[i]);
        }

        return writableArray;
    }
}

@@ -1060,32 +1060,1189 @@
 urn arr;%0A    %7D%0A%0A
+    public static float%5B%5D readableArrayToFloatArray(ReadableArray readableArray) %7B%0A        float%5B%5D arr = new float%5BreadableArray.size()%5D;%0A        for (int i = 0; i %3C readableArray.size(); i++) %7B%0A            arr%5Bi%5D = (float)readableArray.getDouble(i);%0A        %7D%0A%0A        return arr;%0A    %7D%0A%0A    public static int%5B%5D readableArrayToIntArray(ReadableArray readableArray) %7B%0A        int%5B%5D arr = new int%5BreadableArray.size()%5D;%0A        for (int i = 0; i %3C readableArray.size(); i++) %7B%0A            arr%5Bi%5D = readableArray.getInt(i);%0A        %7D%0A%0A        return arr;%0A    %7D%0A%0A    public static byte%5B%5D readableArrayToByteBoolArray(ReadableArray readableArray) %7B%0A        byte%5B%5D arr = new byte%5BreadableArray.size()%5D;%0A        for (int i = 0; i %3C readableArray.size(); i++) %7B%0A            arr%5Bi%5D = (byte)(readableArray.getBoolean(i) ? 1 : 0);%0A        %7D%0A%0A        return arr;%0A    %7D%0A%0A    public static byte%5B%5D readableArrayToByteStringArray(ReadableArray readableArray) %7B%0A        byte%5B%5D arr = new byte%5BreadableArray.size()%5D;%0A        for (int i = 0; i %3C readableArray.size(); i++) %7B%0A            arr%5Bi%5D = Byte.valueOf(readableArray.getString(i));%0A        %7D%0A%0A        return arr;%0A    %7D%0A%0A
     public stati

Create missing function in ArrayConverter