presto-main/src/main/java/io/prestosql/type/IpAddressOperators.java/IpAddressOperators/castFromVarbinaryToIpAddress
class IpAddressOperators:    @ScalarOperator(CAST)
    @SqlType(StandardTypes.IPADDRESS)
    public static Slice castFromVarbinaryToIpAddress(@SqlType("varbinary") Slice slice)
    {
        if (slice.length() == 4) {
            byte[] address = slice.getBytes();
            byte[] bytes = new byte[16];
            bytes[10] = (byte) 0xff;
            bytes[11] = (byte) 0xff;
            arraycopy(address, 0, bytes, 12, 4);
            return wrappedBuffer(bytes);
        }
        if (slice.length() == 16) {
            return slice;
        }
        throw new PrestoException(INVALID_CAST_ARGUMENT, "Invalid IP address binary length: " + slice.length());
    }