@ Override public Blob convert ( IComplexNDArray toConvert ) throws IOException , SQLException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; Nd4j . writeComplex ( toConvert , dos ) ; byte [ ] bytes = bos . toByteArray ( ) ; Connection c = dataSource . getConnection ( ) ; Blob b = c . createBlob ( ) ; b . setBytes ( 1 , bytes ) ; return b ; }
Convert an ndarray to a blob