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 BlobBuffer
The underlyingBlobBuffer
.private static final byte[]
0 lengthbyte[]
as initial value for emptyBlob
s. -
Constructor Summary
ConstructorsConstructorDescriptionBlobImpl
(JtdsConnection connection) Constructs a new emptyBlob
instance.BlobImpl
(JtdsConnection connection, byte[] bytes) Constructs a newBlob
instance initialized with data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
free()
getBinaryStream
(long pos, long length) byte[]
getBytes
(long pos, int length) long
length()
long
position
(byte[] pattern, long start) long
setBinaryStream
(long pos) int
setBytes
(long pos, byte[] bytes) int
setBytes
(long pos, byte[] bytes, int offset, int len) void
truncate
(long len)
-
Field Details
-
EMPTY_BLOB
private static final byte[] EMPTY_BLOB0 lengthbyte[]
as initial value for emptyBlob
s. -
blobBuffer
The underlyingBlobBuffer
.
-
-
Constructor Details
-
BlobImpl
BlobImpl(JtdsConnection connection) Constructs a new emptyBlob
instance.- Parameters:
connection
- a reference to the parent connection object
-
BlobImpl
BlobImpl(JtdsConnection connection, byte[] bytes) Constructs a newBlob
instance initialized with data.- Parameters:
connection
- a reference to the parent connection objectbytes
- the blob object to encapsulate
-
-
Method Details
-
getBinaryStream
- Specified by:
getBinaryStream
in interfaceBlob
- Throws:
SQLException
-
getBytes
- Specified by:
getBytes
in interfaceBlob
- Throws:
SQLException
-
length
- Specified by:
length
in interfaceBlob
- Throws:
SQLException
-
position
- Specified by:
position
in interfaceBlob
- Throws:
SQLException
-
position
- Specified by:
position
in interfaceBlob
- Throws:
SQLException
-
setBinaryStream
- Specified by:
setBinaryStream
in interfaceBlob
- Throws:
SQLException
-
setBytes
- Specified by:
setBytes
in interfaceBlob
- Throws:
SQLException
-
setBytes
- Specified by:
setBytes
in interfaceBlob
- Throws:
SQLException
-
truncate
- Specified by:
truncate
in interfaceBlob
- Throws:
SQLException
-
free
- Specified by:
free
in interfaceBlob
- Throws:
SQLException
-
getBinaryStream
- Specified by:
getBinaryStream
in interfaceBlob
- Throws:
SQLException
-