...
Copying A Blob to A File!
| Code Block |
|---|
... byte_stream_test = blobTest.getBinaryStream() if( byte_stream_test == null ) { println "Test: Received null stream!" } blob_size = blobTest.length() println "Blob size: $blob_size" byte[] byte_array_test = new byte[blob_size] int bytes_read_test = byte_stream_test.read(byte_array_test) println "Read $bytes_read_test from the blob!" // Write to a file def fos= new FileOutputStream('c:\\Jornada\\auxil\\output.jpg') fos.write(byte_array_test); fos.close() ... |