public static byte[] toByteArray(long[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 8]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 8, 8); return byts; }
public static byte[] toByteArray(double[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 8]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 8, 8); return byts; }
public static byte[] toByteArray(long[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 8]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 8, 8); return byts; }
public static byte[] toByteArray(int[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 4]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 4, 4); return byts; }
public static byte[] toByteArray(float[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 4]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 4, 4); return byts; }
public static byte[] toByteArray(char[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 2]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 2, 2); return byts; }
public static byte[] toByteArray(int[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 4]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 4, 4); return byts; }
public static byte[] toByteArray(float data) { return toByteArray(Float.floatToRawIntBits(data)); }
public static byte[] toByteArray(short[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 2]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 2, 2); return byts; }
public static byte[] toByteArray(char[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 2]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 2, 2); return byts; }
public static byte[] toByteArray(double[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 8]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 8, 8); return byts; }
public static byte[] toByteArray(short[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 2]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 2, 2); return byts; }
public static byte[] toByteArray(float[] data) { if (data == null) return null; byte[] byts = new byte[data.length * 4]; for (int i = 0; i < data.length; i++) System.arraycopy(toByteArray(data[i]), 0, byts, i * 4, 4); return byts; }
public static byte[] toByteArray(double data) { return toByteArray(Double.doubleToRawLongBits(data)); }
public static byte[] toByteArray(float data) { return toByteArray(Float.floatToRawIntBits(data)); }
public static void toHttpResponse(int[] x, HttpResponse response, String contentType) throws IOException { toHttpResponse(ConversionUtils.toByteArray(x), response, contentType); }
public static void toHttpResponse(double[] x, HttpResponse response, String contentType) throws IOException { toHttpResponse(ConversionUtils.toByteArray(x), response, contentType); }
public static void toHttpResponse(String x, HttpResponse response, String contentType) throws IOException { toHttpResponse(ConversionUtils.toByteArray(x), response, contentType); }
public static void toHttpResponse(double[] x, HttpResponse response, String contentType) throws IOException { toHttpResponse(ConversionUtils.toByteArray(x), response, contentType); }
public static void toHttpResponse(String x, HttpResponse response, String contentType) throws IOException { toHttpResponse(ConversionUtils.toByteArray(x), response, contentType); }