Here you can find the source of blobToBytes(Blob blob)
Parameter | Description |
---|---|
blob | java.sql.Blob |
public static byte[] blobToBytes(Blob blob)
//package com.java2s; //License from project: Apache License import java.sql.Blob; import java.sql.SQLException; public class Main { /**//w ww.j a va 2 s . c o m * blob to byte array * @param blob java.sql.Blob * @return byte[] */ public static byte[] blobToBytes(Blob blob) { byte[] bytes = null; if (blob == null) return bytes; try { bytes = blob.getBytes(1, (int) blob.length()); } catch (SQLException e) { e.printStackTrace(); } return bytes; } }