Package net.sourceforge.jtds.jdbc
Class BlobImpl
java.lang.Object
net.sourceforge.jtds.jdbc.BlobImpl
- All Implemented Interfaces:
Blob
An in-memory or disk based representation of binary data.
- Version:
- $Id: BlobImpl.java,v 1.31.2.3 2009-12-30 08:45:34 ickzon Exp $
- Author:
- Brian Heineman, Mike Hutchinson
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlobBufferThe underlyingBlobBuffer.private static final byte[]0 lengthbyte[]as initial value for emptyBlobs. -
Constructor Summary
ConstructorsConstructorDescriptionBlobImpl(JtdsConnection connection) Constructs a new emptyBlobinstance.BlobImpl(JtdsConnection connection, byte[] bytes) Constructs a newBlobinstance initialized with data. -
Method Summary
Modifier and TypeMethodDescriptionvoidfree()getBinaryStream(long pos, long length) byte[]getBytes(long pos, int length) longlength()longposition(byte[] pattern, long start) longsetBinaryStream(long pos) intsetBytes(long pos, byte[] bytes) intsetBytes(long pos, byte[] bytes, int offset, int len) voidtruncate(long len)
-
Field Details
-
EMPTY_BLOB
private static final byte[] EMPTY_BLOB0 lengthbyte[]as initial value for emptyBlobs. -
blobBuffer
The underlyingBlobBuffer.
-
-
Constructor Details
-
BlobImpl
BlobImpl(JtdsConnection connection) Constructs a new emptyBlobinstance.- Parameters:
connection- a reference to the parent connection object
-
BlobImpl
BlobImpl(JtdsConnection connection, byte[] bytes) Constructs a newBlobinstance initialized with data.- Parameters:
connection- a reference to the parent connection objectbytes- the blob object to encapsulate
-
-
Method Details
-
getBinaryStream
- Specified by:
getBinaryStreamin interfaceBlob- Throws:
SQLException
-
getBytes
- Specified by:
getBytesin interfaceBlob- Throws:
SQLException
-
length
- Specified by:
lengthin interfaceBlob- Throws:
SQLException
-
position
- Specified by:
positionin interfaceBlob- Throws:
SQLException
-
position
- Specified by:
positionin interfaceBlob- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStreamin interfaceBlob- Throws:
SQLException
-
setBytes
- Specified by:
setBytesin interfaceBlob- Throws:
SQLException
-
setBytes
- Specified by:
setBytesin interfaceBlob- Throws:
SQLException
-
truncate
- Specified by:
truncatein interfaceBlob- Throws:
SQLException
-
free
- Specified by:
freein interfaceBlob- Throws:
SQLException
-
getBinaryStream
- Specified by:
getBinaryStreamin interfaceBlob- Throws:
SQLException
-