OdbcDataReader.GetBytes(Int32, Int64, Byte[], Int32, Int32) 메서드

정의

특정 버퍼 오프셋에서 시작하여 지정된 열 오프셋의 바이트 스트림을 버퍼에 배열로 읽어 들입니다.

public:
 override long GetBytes(int i, long dataIndex, cli::array <System::Byte> ^ buffer, int bufferIndex, int length);
public:
 virtual long GetBytes(int i, long dataIndex, cli::array <System::Byte> ^ buffer, int bufferIndex, int length);
public override long GetBytes (int i, long dataIndex, byte[] buffer, int bufferIndex, int length);
public override long GetBytes (int i, long dataIndex, byte[]? buffer, int bufferIndex, int length);
public long GetBytes (int i, long dataIndex, byte[] buffer, int bufferIndex, int length);
override this.GetBytes : int * int64 * byte[] * int * int -> int64
abstract member GetBytes : int * int64 * byte[] * int * int -> int64
override this.GetBytes : int * int64 * byte[] * int * int -> int64
Public Overrides Function GetBytes (i As Integer, dataIndex As Long, buffer As Byte(), bufferIndex As Integer, length As Integer) As Long
Public Function GetBytes (i As Integer, dataIndex As Long, buffer As Byte(), bufferIndex As Integer, length As Integer) As Long

매개 변수

i
Int32

열 서수(0부터 시작)입니다.

dataIndex
Int64

읽기 작업을 시작할 필드 내 인덱스입니다.

buffer
Byte[]

바이트 스트림을 읽을 버퍼입니다.

bufferIndex
Int32

쓰기 작업을 시작할 buffer 내 인덱스입니다.

length
Int32

읽을 바이트 수입니다.

반환

읽은 실제 바이트 수입니다.

구현

설명

GetBytes 필드에 사용할 수 있는 바이트 수를 반환합니다. 대부분의 경우이 값은 필드의 정확한 길이입니다. 그러나 반환 된 숫자 보다 작을 수도 있습니다 필드의 길이 경우 GetBytes 바이트를 얻는 필드에서 이미 사용 되었습니다. 예를 들어 가 큰 데이터 구조를 버퍼로 읽는 경우 OdbcDataReader 일 수 있습니다. 자세한 내용은 에 SequentialAccess 대한 설정을 참조하세요 CommandBehavior.

null 값 GetBytes 인 버퍼를 전달하면 필드의 길이를 바이트 단위로 반환합니다.

변환은 ODBC 드라이버의 기본 기능에 따라 수행됩니다. 변환이 지원되지 않으면 메서드 호출이 실패합니다.

참고

bufferIndex 이 배열 외부에 있으면 예외가 throw되지 않습니다. 데이터를 읽지 않으며 메서드는 0을 반환합니다.

적용 대상

추가 정보