@Test public void testDoubleBinary() throws Exception { final double[] doubles = new double[13]; for (int i = 0; i < 13; ++i) { doubles[i] = i - 3.1; } final PgArray pgArray = new PgArray(null, Oid.FLOAT8_ARRAY, doubleArrays.toBinaryRepresentation(null, doubles)); Object arrayObj = pgArray.getArray(); assertThat(arrayObj, instanceOf(Double[].class)); final Double[] actual = (Double[]) arrayObj; assertEquals(doubles.length, actual.length); for (int i = 0; i < doubles.length; ++i) { assertEquals(Double.valueOf(doubles[i]), actual[i]); } }
public abstract byte[] toBinaryRepresentation(Connection connection, A array) throws SQLFeatureNotSupportedException;
PrimitiveArraySupport { public abstract byte[] toBinaryRepresentation(Connection connection, A array) throws SQLFeatureNotSupportedException; }
PrimitiveArraySupport { public abstract byte[] toBinaryRepresentation(Connection connection, A array) throws SQLFeatureNotSupportedException;  }
PrimitiveArraySupport { public abstract byte[] toBinaryRepresentation(Connection connection, A array) throws SQLFeatureNotSupportedException;  abstract int getDefaultArrayTypeOid(TypeInfo tiCache); abstract String toArrayString(char delim, A array); abstract void appendArray(StringBuilder sb, char delim, A array); boolean supportBinaryRepresentation(); abstract byte[] toBinaryRepresentation(Connection connection, A array); static boolean isSupportedPrimitiveArray(Object obj); static PrimitiveArraySupport<A> getArraySupport(A array); }
PrimitiveArraySupport { public abstract byte[] toBinaryRepresentation(Connection connection, A array) throws SQLFeatureNotSupportedException;  abstract int getDefaultArrayTypeOid(TypeInfo tiCache); abstract String toArrayString(char delim, A array); abstract void appendArray(StringBuilder sb, char delim, A array); boolean supportBinaryRepresentation(); abstract byte[] toBinaryRepresentation(Connection connection, A array); static boolean isSupportedPrimitiveArray(Object obj); static PrimitiveArraySupport<A> getArraySupport(A array);  }