question: public static ValueLobDb createTempBlob ( InputStream in , long length , DataHandler handler ) { try { long remaining = Long . MAX_VALUE ; boolean compress = handler . getLobCompressionAlgorithm ( Value . BLOB ) != null ; if ( length >= 0 && length < remaining ) { remaining = length ; } int len = getBufferSize ( handler , compress , remaining ) ; byte [ ] buff ; if ( len >= Integer . MAX_VALUE ) { buff = IOUtils . readBytesAndClose ( in , - 1 ) ; len = buff . length ; } else { buff = DataUtils . newBytes ( len ) ; len = IOUtils . readFully ( in , buff , len ) ; } if ( len <= handler . getMaxLengthInplaceLob ( ) ) { byte [ ] small = DataUtils . newBytes ( len ) ; System . arraycopy ( buff , 0 , small , 0 , len ) ; return ValueLobDb . createSmallLob ( Value . BLOB , small , small . length ) ; } ValueLobDb lob = new ValueLobDb ( handler , buff , len , in , remaining ) ; return lob ; } catch ( IOException e ) { throw DbException . convertIOException ( e , null ) ; } }
target:  Create a temporary BLOB value from a stream.