Code example for Blob

Methods: getBinaryStream

0
         
         
        ObjectInputStream in = null;
        try { 
            //in = new ObjectInputStream(new ByteArrayInputStream(bytes)); 
            in = new ObjectInputStream(blob.getBinaryStream());
            return in.readObject();
        } catch (IOException e) {
            throw new HibernateException(e);
        } catch (ClassNotFoundException e) {
            throw new HibernateException(e);
        } 
        finally { 
            if (in != null) {
                try { 
                    in.close();
                } catch (IOException e) {}
            } 
        } 
    }