/** * {@inheritDoc} * * @throws SQLFeatureNotSupportedException * Because this feature is not supported. */ @Override public byte[] toBinaryRepresentation(Connection connection, boolean[] array) throws SQLFeatureNotSupportedException { int length = 20 + (5 * array.length); final byte[] bytes = new byte[length]; // 1 dimension ByteConverter.int4(bytes, 0, 1); // no null ByteConverter.int4(bytes, 4, 0); // oid ByteConverter.int4(bytes, 8, Oid.BOOL); // length ByteConverter.int4(bytes, 12, array.length); int idx = 20; for (int i = 0; i < array.length; ++i) { bytes[idx + 3] = 1; ByteConverter.bool(bytes, idx + 4, array[i]); idx += 5; } return bytes; }
break; case Oid.BOOL: arr[i] = ByteConverter.bool(fieldBytes, pos); break; default: