class BlobToByteArrayMapper implements TypeMapper<Blob, byte[]> {

    @Override
    public String getLabel() {
        return "Blob to byte Array";
    }

    @Override
    public Type getJavaType(Column column) {
        return byte[].class;
    }

    @Override
    public byte[] toJavaType(Column column, Class<?> entityType, Blob value) {<FILL_FUNCTION_BODY>}

    @Override
    public Blob toDatabaseType(byte[] value) {
        if (value == null) {
            return null;
        }
        return new StandardBlob(value);
    }

}

        if (value == null) {
            return null;
        } else try {
            if (value.length() < Integer.MAX_VALUE) {
                return value.getBytes(1, (int) value.length());
            } else {
                throw new SpeedmentTypeMapperException(
                    "The provided Blob contains too many characters >" + Integer.MAX_VALUE
                );
            }
        } catch (final SQLException sqle) {
            throw new SpeedmentTypeMapperException("Unable to convert Blob to byte[].", sqle);
        }
    
<no_super_class>