@ Override public INDArray load ( Blob blob ) throws SQLException { if ( blob == null ) return null ; try ( InputStream is = blob . getBinaryStream ( ) ) { ByteBuffer direct = ByteBuffer . allocateDirect ( ( int ) blob . length ( ) ) ; ReadableByteChannel readableByteChannel = Channels . newChannel ( is ) ; readableByteChannel . read ( direct ) ; Buffer byteBuffer = ( Buffer ) direct ; byteBuffer . rewind ( ) ; return BinarySerde . toArray ( direct ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Load an ndarray from a blob