Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.48 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. showing database image into canvas in java
  2. blobCitizen=rsPersonalInfo.getBlob("citizen_image");
  3.        
  4. public byte[] convertBlobToByteArray(Blob itStrm)
  5. {
  6.     InputStream is;    
  7.     byte[] bytes=null;
  8.     try {
  9.         is = itStrm.getBinaryStream();
  10.         bytes = new byte[(int)itStrm.length()];
  11.             is.read(bytes);
  12.             is.close();
  13.  
  14.     } catch (Exception e) {
  15.         // TODO Auto-generated catch block
  16.         e.printStackTrace();
  17.     }      
  18.     return bytes;
  19. }