Bug #17706 Blob.getBinaryStream Inbound Streaming
Submitted: 24 Feb 2006 18:27 Modified: 11 Nov 2009 2:36
Reporter: Richard Wareing Email Updates:
Status: Won't fix Impact on me:
None 
Category:Connector / J Severity:S4 (Feature request)
Version:3.1.12 OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[24 Feb 2006 18:27] Richard Wareing
Description:
Currently the Blob implementation simply returns a ByteArrayInputStream of the blob data:

	public java.io.InputStream getBinaryStream() throws SQLException {
		return new ByteArrayInputStream(getBinaryData());
	}

It would be nice if there were altered to support true streaming of data from the database, as in many applications it may be useful to read from an offset into the Blob data.  e.g. doing a myInputStream.read( bArray, myOffset, readLength )

Thanks in Advance,

Richard...

How to repeat:
Look at com.mysql.jdbc.Blob.java implementation source :).
[24 Feb 2006 18:55] Mark Matthews
The database itself doesn't actually support streaming of binary data (yet). You can somewhat emulate it with the emulated locator-based blobs, see "emulateLocators=true" in the documentation.