JDBC Blob。如需查看此类的文档,请参阅 java.sql.Blob
。
方法
| 方法 | 返回类型 | 简介 |
|---|---|---|
free() | void | 如需查看此方法的文档,请参阅
java.sql.Blob#free()。 |
get | Blob | 以 Apps 脚本 blob 的形式获取相应 JdbcBlob 的内容。 |
get | Blob | 以转换为指定内容类型的 blob 形式返回此对象内的数据。 |
get | Byte[] | 如需查看此方法的文档,请参阅
java.sql.Blob#getBytes(long, int)。 |
length() | Integer | 如需查看此方法的文档,请参阅
java.sql.Blob#length()。 |
position(pattern, start) | Integer | 如需查看此方法的文档,请参阅
java.sql.Blob#position(byte[], long)。 |
position(pattern, start) | Integer | 如需查看此方法的文档,请参阅
java.sql.Blob#position(blob, long)。 |
set | Integer | 用于将 Jdbc 写入此 blob 的便捷方法。 |
set | Integer | 用于将 Jdbc 写入此 blob 的便捷方法。 |
set | Integer | 如需查看此方法的文档,请参阅
java.sql.Blob#setBytes(long, byte[])。 |
set | Integer | 如需查看此方法的文档,请参阅
java.sql.Blob#setBytes(long, byte[], int, int)。 |
truncate(length) | void | 如需查看此方法的文档,请参阅
java.sql.Blob#truncate(long)。 |
详细文档
free()
如需查看此方法的文档,请参阅
java.sql.Blob#free()。
getAs(contentType)
以转换为指定内容类型的 blob 形式返回此对象内的数据。此方法会向文件名添加适当的扩展名,例如“myfile.pdf”。不过,它会假设文件名中最后一个句点(如果有)后面的部分是应替换的现有扩展名。因此,“ShoppingList.12.25.2014”会变为“ShoppingList.12.25.pdf”。
如需查看转化方面的每日配额,请参阅 Google 服务的配额。新创建的 Google Workspace 网域可能暂时受到更严格的配额限制。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
content | String | 要转换成的 MIME 类型。对于大多数 blob,'application/pdf' 是唯一有效的选项。对于采用 BMP、GIF、JPEG 或 PNG 格式的图片,'image/bmp'、'image/gif'、'image/jpeg' 或 'image/png' 中的任何一个也有效。对于 Google 文档,'text/markdown' 也有效。 |
返回
Blob - 以 blob 形式呈现的数据。
getBytes(position, length)
如需查看此方法的文档,请参阅
java.sql.Blob#getBytes(long, int)。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
position | Integer | 要提取的 Blob 值中第一个字节的序号位置;第一个字节位于位置 1。 |
length | Integer | 要复制的连续字节数;长度值必须大于或等于零。 |
返回
Byte[] - 一个字节数组,包含 Blob 值中最多指定数量的连续字节。
length()
position(pattern, start)
如需查看此方法的文档,请参阅
java.sql.Blob#position(byte[], long)。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
pattern | Byte[] | 要搜索的字节数组。 |
start | Integer | 开始搜索的 blob 值中的位置;第一个位置为 1。 |
返回
Integer - 指定的模式开始的位置,如果未找到该模式,则为 -1。
position(pattern, start)
如需查看此方法的文档,请参阅
java.sql.Blob#position(blob, long)。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
pattern | Jdbc | 表示要搜索的值的 Jdbc。 |
start | Integer | 开始搜索的 blob 值中的位置;第一个位置为 1。 |
返回
Integer - 指定的模式开始的位置,如果未找到该模式,则为 -1。
setBytes(position, blobSource)
用于将 JdbcBlob 写入此 blob 的便捷方法。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
position | Integer | 开始写入的 blob 中的位置;第一个位置为 1。 |
blob | Blob | 要写入此 blob 的数据源。 |
返回
Integer - 写入的字节数。
setBytes(position, blobSource, offset, length)
用于将 JdbcBlob 写入此 blob 的便捷方法。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
position | Integer | 开始写入的 blob 中的位置;第一个位置为 1。 |
blob | Blob | 要写入此 blob 的数据源。 |
offset | Integer | 所提供字节数组中的偏移量,用于指定开始读取字节的位置。 |
length | Integer | 要写入到 Blob 的字节数。 |
返回
Integer - 写入的字节数。
setBytes(position, bytes)
如需查看此方法的文档,请参阅
java.sql.Blob#setBytes(long, byte[])。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
position | Integer | 开始写入的 blob 中的位置;第一个位置为 1。 |
bytes | Byte[] | 要写入相应 Blob 的字节数组。 |
返回
Integer - 写入的字节数。
setBytes(position, bytes, offset, length)
如需查看此方法的文档,请参阅
java.sql.Blob#setBytes(long, byte[], int, int)。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
position | Integer | 开始写入的 blob 中的位置;第一个位置为 1。 |
bytes | Byte[] | 要写入相应 Blob 的字节数组。 |
offset | Integer | 所提供字节数组中开始读取字节以进行设置的偏移量。 |
length | Integer | 要写入到 Blob 的字节数。 |
返回
Integer - 写入的字节数。