@Test public void testLongBinary() throws Exception { final long[] longs = new long[84]; for (int i = 0; i < 84; ++i) { longs[i] = i - 3; } final PgArray pgArray = new PgArray(null, Oid.INT8_ARRAY, longArrays.toBinaryRepresentation(null, longs)); Object arrayObj = pgArray.getArray(); assertThat(arrayObj, instanceOf(Long[].class)); final Long[] actual = (Long[]) arrayObj; assertEquals(longs.length, actual.length); for (int i = 0; i < longs.length; ++i) { assertEquals(Long.valueOf(longs[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);  }