Share via


IBlob.SetBytes Method

Definition

Overloads

SetBytes(Int64, Byte[])

Writes the given array of bytes to the BLOB value that this Blob object represents, starting at position pos, and returns the number of bytes written.

SetBytes(Int64, Byte[], Int32, Int32)

Writes all or part of the given byte array to the BLOB value that this Blob object represents and returns the number of bytes written.

SetBytes(Int64, Byte[])

Writes the given array of bytes to the BLOB value that this Blob object represents, starting at position pos, and returns the number of bytes written.

[Android.Runtime.Register("setBytes", "(J[B)I", "GetSetBytes_JarrayBHandler:Java.Sql.IBlobInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public int SetBytes (long pos, byte[]? bytes);
[<Android.Runtime.Register("setBytes", "(J[B)I", "GetSetBytes_JarrayBHandler:Java.Sql.IBlobInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetBytes : int64 * byte[] -> int

Parameters

pos
Int64

the position in the BLOB object at which to start writing; the first position is 1

bytes
Byte[]

the array of bytes to be written to the BLOB value that this Blob object represents

Returns

the number of bytes written

Attributes

Exceptions

if an error occurs accessing the Blob.

Remarks

Writes the given array of bytes to the BLOB value that this Blob object represents, starting at position pos, and returns the number of bytes written. The array of bytes will overwrite the existing bytes in the Blob object starting at the position pos. If the end of the Blob value is reached while writing the array of bytes, then the length of the Blob value will be increased to accomodate the extra bytes.

<b>Note:</b> If the value specified for pos is greater then the length+1 of the BLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.

Added in 1.4.

Java documentation for java.sql.Blob.setBytes(long, byte[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetBytes(Int64, Byte[], Int32, Int32)

Writes all or part of the given byte array to the BLOB value that this Blob object represents and returns the number of bytes written.

[Android.Runtime.Register("setBytes", "(J[BII)I", "GetSetBytes_JarrayBIIHandler:Java.Sql.IBlobInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public int SetBytes (long pos, byte[]? bytes, int offset, int len);
[<Android.Runtime.Register("setBytes", "(J[BII)I", "GetSetBytes_JarrayBIIHandler:Java.Sql.IBlobInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetBytes : int64 * byte[] * int * int -> int

Parameters

pos
Int64

the position in the BLOB object at which to start writing; the first position is 1

bytes
Byte[]

the array of bytes to be written to this BLOB object

offset
Int32

the offset into the array bytes at which to start reading the bytes to be set

len
Int32

the number of bytes to be written to the BLOB value from the array of bytes bytes

Returns

the number of bytes written

Attributes

Exceptions

if an error occurs accessing the Blob.

Remarks

Writes all or part of the given byte array to the BLOB value that this Blob object represents and returns the number of bytes written. Writing starts at position pos in the BLOB value; len bytes from the given byte array are written. The array of bytes will overwrite the existing bytes in the Blob object starting at the position pos. If the end of the Blob value is reached while writing the array of bytes, then the length of the Blob value will be increased to accomodate the extra bytes.

<b>Note:</b> If the value specified for pos is greater then the length+1 of the BLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.

Added in 1.4.

Java documentation for java.sql.Blob.setBytes(long, byte[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to