use of org.firebirdsql.jdbc.FBBlob in project jaybird by FirebirdSQL.
the class FBBlobField method getBlobInternal.
protected FirebirdBlob getBlobInternal() {
if (blob != null)
return blob;
final byte[] bytes = getFieldData();
if (bytes == null)
return null;
/*@todo convert this into a method of FirebirdConnection */
blob = new FBBlob(gdsHelper, getDatatypeCoder().decodeLong(bytes));
return blob;
}
use of org.firebirdsql.jdbc.FBBlob in project jaybird by FirebirdSQL.
the class FBBlobField method copyBytes.
private void copyBytes(byte[] bytes, int length) throws SQLException {
FBBlob blob = new FBBlob(gdsHelper);
blob.copyBytes(bytes, 0, length);
setFieldData(getDatatypeCoder().encodeLong(blob.getBlobId()));
blobExplicitNull = false;
}
use of org.firebirdsql.jdbc.FBBlob in project jaybird by FirebirdSQL.
the class FBLongVarCharField method copyCharacterStream.
private void copyCharacterStream(Reader in, long length) throws SQLException {
FBBlob blob = new FBBlob(gdsHelper);
// TODO Push this down into FBBlob?
Encoding encoding = getDatatypeCoder().getEncoding();
blob.copyCharacterStream(in, length, encoding);
setFieldData(getDatatypeCoder().encodeLong(blob.getBlobId()));
blobExplicitNull = false;
}
use of org.firebirdsql.jdbc.FBBlob in project jaybird by FirebirdSQL.
the class FBLongVarCharField method setClob.
@Override
public void setClob(FBClob clob) throws SQLException {
FBBlob blob = clob.getWrappedBlob();
setBlob(blob);
}
use of org.firebirdsql.jdbc.FBBlob in project jaybird by FirebirdSQL.
the class FBLongVarCharField method copyBinaryStream.
private void copyBinaryStream(InputStream in, long length) throws SQLException {
FBBlob blob = new FBBlob(gdsHelper);
blob.copyStream(in, length);
setFieldData(getDatatypeCoder().encodeLong(blob.getBlobId()));
blobExplicitNull = false;
}