static boolean[] readArray(boolean[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = in.readBoolean(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static int[] readArray(int[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = in.readInt(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static double[] readArray(double[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = in.readDouble(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static short[] readArray(short[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = (short) in.readInt(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static float[] readArray(float[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = in.readFloat(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static char[] readArray(char[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = (char) in.readInt(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static long[] readArray(long[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = in.readLong(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static long[] readArray(long[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = in.readLong(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static float[] readArray(float[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = in.readFloat(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static double[] readArray(double[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = in.readDouble(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static boolean[] readArray(boolean[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = in.readBoolean(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static int[] readArray(int[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = in.readInt(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static short[] readArray(short[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = (short) in.readInt(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
static char[] readArray(char[] array, long l, ResolvingDecoder in) throws IOException { int index = 0; do { int limit = index + (int) l; if (array.length < limit) { array = Arrays.copyOf(array, limit); } while (index < limit) { array[index] = (char) in.readInt(); index++; } } while ((l = in.arrayNext()) > 0); return array; }
private Object readCollection(Collection<Object> c, Schema expectedType, long l, ResolvingDecoder in) throws IOException { LogicalType logicalType = expectedType.getLogicalType(); Conversion<?> conversion = getData().getConversionFor(logicalType); if (logicalType != null && conversion != null) { do { for (int i = 0; i < l; i++) { Object element = readWithConversion( null, expectedType, logicalType, conversion, in); c.add(element); } } while ((l = in.arrayNext()) > 0); } else { do { for (int i = 0; i < l; i++) { Object element = readWithoutConversion(null, expectedType, in); c.add(element); } } while ((l = in.arrayNext()) > 0); } return c; }
private Object readCollection(Collection<Object> c, Schema expectedType, long l, ResolvingDecoder in) throws IOException { LogicalType logicalType = expectedType.getLogicalType(); Conversion<?> conversion = getData().getConversionFor(logicalType); if (logicalType != null && conversion != null) { do { for (int i = 0; i < l; i++) { Object element = readWithConversion( null, expectedType, logicalType, conversion, in); c.add(element); } } while ((l = in.arrayNext()) > 0); } else { do { for (int i = 0; i < l; i++) { Object element = readWithoutConversion(null, expectedType, in); c.add(element); } } while ((l = in.arrayNext()) > 0); } return c; }
private Object readObjectArray(Object[] array, Schema expectedType, long l, ResolvingDecoder in) throws IOException { LogicalType logicalType = expectedType.getLogicalType(); Conversion<?> conversion = getData().getConversionFor(logicalType); int index = 0; if (logicalType != null && conversion != null) { do { int limit = index + (int) l; while (index < limit) { Object element = readWithConversion( null, expectedType, logicalType, conversion, in); array[index] = element; index++; } } while ((l = in.arrayNext()) > 0); } else { do { int limit = index + (int) l; while (index < limit) { Object element = readWithoutConversion(null, expectedType, in); array[index] = element; index++; } } while ((l = in.arrayNext()) > 0); } return array; }
private Object readObjectArray(Object[] array, Schema expectedType, long l, ResolvingDecoder in) throws IOException { LogicalType logicalType = expectedType.getLogicalType(); Conversion<?> conversion = getData().getConversionFor(logicalType); int index = 0; if (logicalType != null && conversion != null) { do { int limit = index + (int) l; while (index < limit) { Object element = readWithConversion( null, expectedType, logicalType, conversion, in); array[index] = element; index++; } } while ((l = in.arrayNext()) > 0); } else { do { int limit = index + (int) l; while (index < limit) { Object element = readWithoutConversion(null, expectedType, in); array[index] = element; index++; } } while ((l = in.arrayNext()) > 0); } return array; }
/** Called to read an array instance. May be overridden for alternate array * representations.*/ protected Object readArray(Object old, Schema expected, ResolvingDecoder in) throws IOException { Schema expectedType = expected.getElementType(); long l = in.readArrayStart(); long base = 0; if (l > 0) { LogicalType logicalType = expectedType.getLogicalType(); Conversion<?> conversion = getData().getConversionFor(logicalType); Object array = newArray(old, (int) l, expected); do { if (logicalType != null && conversion != null) { for (long i = 0; i < l; i++) { addToArray(array, base + i, readWithConversion( peekArray(array), expectedType, logicalType, conversion, in)); } } else { for (long i = 0; i < l; i++) { addToArray(array, base + i, readWithoutConversion( peekArray(array), expectedType, in)); } } base += l; } while ((l = in.arrayNext()) > 0); return array; } else { return newArray(old, 0, expected); } }
/** Called to read an array instance. May be overridden for alternate array * representations.*/ protected Object readArray(Object old, Schema expected, ResolvingDecoder in) throws IOException { Schema expectedType = expected.getElementType(); long l = in.readArrayStart(); long base = 0; if (l > 0) { LogicalType logicalType = expectedType.getLogicalType(); Conversion<?> conversion = getData().getConversionFor(logicalType); Object array = newArray(old, (int) l, expected); do { if (logicalType != null && conversion != null) { for (long i = 0; i < l; i++) { addToArray(array, base + i, readWithConversion( peekArray(array), expectedType, logicalType, conversion, in)); } } else { for (long i = 0; i < l; i++) { addToArray(array, base + i, readWithoutConversion( peekArray(array), expectedType, in)); } } base += l; } while ((l = in.arrayNext()) > 0); return pruneArray(array); } else { return pruneArray(newArray(old, 0, expected)); } }