@Test public void testMakePrimitiveArray() throws InvalidRangeException { Object sresult = IospHelper.makePrimitiveArray(10, DataType.STRING); String[] stringFill = (String[]) sresult; for (String s : stringFill) { assertThat(s).isEqualTo(null); } }
public static Object makePrimitiveArray(int size, DataType dataType) { Object arr = null; if ((dataType.getPrimitiveClassType() == byte.class) || (dataType == DataType.CHAR) || (dataType == DataType.OPAQUE) || (dataType == DataType.STRUCTURE)) { arr = new byte[size]; } else if (dataType.getPrimitiveClassType() == short.class) { arr = new short[size]; } else if (dataType.getPrimitiveClassType() == int.class) { arr = new int[size]; } else if (dataType.getPrimitiveClassType() == long.class) { arr = new long[size]; } else if (dataType == DataType.FLOAT) { arr = new float[size]; } else if (dataType == DataType.DOUBLE) { arr = new double[size]; } else if (dataType == DataType.STRING) { arr = new String[size]; } return arr; }
IospHelper { public static Object makePrimitiveArray(int size, DataType dataType) { Object arr = null; if ((dataType.getPrimitiveClassType() == byte.class) || (dataType == DataType.CHAR) || (dataType == DataType.OPAQUE) || (dataType == DataType.STRUCTURE)) { arr = new byte[size]; } else if (dataType.getPrimitiveClassType() == short.class) { arr = new short[size]; } else if (dataType.getPrimitiveClassType() == int.class) { arr = new int[size]; } else if (dataType.getPrimitiveClassType() == long.class) { arr = new long[size]; } else if (dataType == DataType.FLOAT) { arr = new float[size]; } else if (dataType == DataType.DOUBLE) { arr = new double[size]; } else if (dataType == DataType.STRING) { arr = new String[size]; } return arr; } }
IospHelper { public static Object makePrimitiveArray(int size, DataType dataType) { Object arr = null; if ((dataType.getPrimitiveClassType() == byte.class) || (dataType == DataType.CHAR) || (dataType == DataType.OPAQUE) || (dataType == DataType.STRUCTURE)) { arr = new byte[size]; } else if (dataType.getPrimitiveClassType() == short.class) { arr = new short[size]; } else if (dataType.getPrimitiveClassType() == int.class) { arr = new int[size]; } else if (dataType.getPrimitiveClassType() == long.class) { arr = new long[size]; } else if (dataType == DataType.FLOAT) { arr = new float[size]; } else if (dataType == DataType.DOUBLE) { arr = new double[size]; } else if (dataType == DataType.STRING) { arr = new String[size]; } return arr; }  }
IospHelper { public static Object makePrimitiveArray(int size, DataType dataType) { Object arr = null; if ((dataType.getPrimitiveClassType() == byte.class) || (dataType == DataType.CHAR) || (dataType == DataType.OPAQUE) || (dataType == DataType.STRUCTURE)) { arr = new byte[size]; } else if (dataType.getPrimitiveClassType() == short.class) { arr = new short[size]; } else if (dataType.getPrimitiveClassType() == int.class) { arr = new int[size]; } else if (dataType.getPrimitiveClassType() == long.class) { arr = new long[size]; } else if (dataType == DataType.FLOAT) { arr = new float[size]; } else if (dataType == DataType.DOUBLE) { arr = new double[size]; } else if (dataType == DataType.STRING) { arr = new String[size]; } return arr; }  static Object readDataFill(RandomAccessFile raf, Layout index, DataType dataType, Object fillValue,
      int byteOrder); static Object readDataFill(RandomAccessFile raf, Layout index, DataType dataType, Object fillValue,
      int byteOrder, boolean convertChar); static Object readData(RandomAccessFile raf, Layout layout, DataType dataType, Object arr, int byteOrder,
      boolean convertChar); static Object readDataFill(PositioningDataInputStream is, Layout index, DataType dataType, Object fillValue); static Object readData(PositioningDataInputStream raf, Layout index, DataType dataType, Object arr); static Object readDataFill(LayoutBB layout, DataType dataType, Object fillValue); static Object readData(LayoutBB layout, DataType dataType, Object arr); static long copyToOutputStream(Array data, OutputStream out); static Object makePrimitiveArray(int size, DataType dataType); static Object makePrimitiveArray(int size, DataType dataType, Object fillValue); static char[] convertByteToCharUTF(byte[] byteArray); static byte[] convertCharToByteUTF(char[] from); static char[] convertByteToChar(byte[] byteArray); static byte[] convertCharToByte(char[] from); static ucar.ma2.Array readSection(ParsedSectionSpec cer); }
IospHelper { public static Object makePrimitiveArray(int size, DataType dataType) { Object arr = null; if ((dataType.getPrimitiveClassType() == byte.class) || (dataType == DataType.CHAR) || (dataType == DataType.OPAQUE) || (dataType == DataType.STRUCTURE)) { arr = new byte[size]; } else if (dataType.getPrimitiveClassType() == short.class) { arr = new short[size]; } else if (dataType.getPrimitiveClassType() == int.class) { arr = new int[size]; } else if (dataType.getPrimitiveClassType() == long.class) { arr = new long[size]; } else if (dataType == DataType.FLOAT) { arr = new float[size]; } else if (dataType == DataType.DOUBLE) { arr = new double[size]; } else if (dataType == DataType.STRING) { arr = new String[size]; } return arr; }  static Object readDataFill(RandomAccessFile raf, Layout index, DataType dataType, Object fillValue,
      int byteOrder); static Object readDataFill(RandomAccessFile raf, Layout index, DataType dataType, Object fillValue,
      int byteOrder, boolean convertChar); static Object readData(RandomAccessFile raf, Layout layout, DataType dataType, Object arr, int byteOrder,
      boolean convertChar); static Object readDataFill(PositioningDataInputStream is, Layout index, DataType dataType, Object fillValue); static Object readData(PositioningDataInputStream raf, Layout index, DataType dataType, Object arr); static Object readDataFill(LayoutBB layout, DataType dataType, Object fillValue); static Object readData(LayoutBB layout, DataType dataType, Object arr); static long copyToOutputStream(Array data, OutputStream out); static Object makePrimitiveArray(int size, DataType dataType); static Object makePrimitiveArray(int size, DataType dataType, Object fillValue); static char[] convertByteToCharUTF(byte[] byteArray); static byte[] convertCharToByteUTF(char[] from); static char[] convertByteToChar(byte[] byteArray); static byte[] convertCharToByte(char[] from); static ucar.ma2.Array readSection(ParsedSectionSpec cer);  }