Class ArrayEncoding.TwoDimensionPrimitiveArrayEncoder<A>

    • Constructor Detail

      • TwoDimensionPrimitiveArrayEncoder

        TwoDimensionPrimitiveArrayEncoder​(ArrayEncoding.AbstractArrayEncoder<A> support)
        Parameters:
        support - The instance providing support for the base array type.
    • Method Detail

      • getDefaultArrayTypeOid

        public int getDefaultArrayTypeOid()
        The default array type oid supported by this instance.
        Specified by:
        getDefaultArrayTypeOid in interface ArrayEncoding.ArrayEncoder<A>
        Returns:
        The default array type oid supported by this instance.
      • toArrayString

        public java.lang.String toArrayString​(char delim,
                                              A[] array)
        Creates String representation of the array.
        Specified by:
        toArrayString in interface ArrayEncoding.ArrayEncoder<A>
        Parameters:
        delim - The character to use to delimit between elements.
        array - The array to represent as a String.
        Returns:
        String representation of the array.
      • appendArray

        public void appendArray​(java.lang.StringBuilder sb,
                                char delim,
                                A[] array)
        Append String representation of array to sb.
        Specified by:
        appendArray in interface ArrayEncoding.ArrayEncoder<A>
        Parameters:
        sb - The StringBuilder to append to.
        delim - The delimiter between elements.
        array - The array to represent. Will not be null, but may contain null elements.
      • toBinaryRepresentation

        public byte[] toBinaryRepresentation​(BaseConnection connection,
                                             A[] array,
                                             int oid)
                                      throws java.sql.SQLException,
                                             java.sql.SQLFeatureNotSupportedException
        Creates binary representation of the array. 4 bytes - dimension 4 bytes - oid 4 bytes - ? 8*d bytes - dimension length
        Specified by:
        toBinaryRepresentation in interface ArrayEncoding.ArrayEncoder<A>
        Parameters:
        connection - The connection the binary representation will be used on. Attributes from the connection might impact how values are translated to binary.
        array - The array to binary encode. Must not be null, but may contain null elements.
        oid - The array type oid to use. Calls to ArrayEncoding.ArrayEncoder.supportBinaryRepresentation(int) must have returned true.
        Returns:
        The binary representation of array.
        Throws:
        java.sql.SQLFeatureNotSupportedException - If ArrayEncoding.ArrayEncoder.supportBinaryRepresentation(int) is false for oid.
        java.sql.SQLException