Пример #1
0
// GetChunkSize returns the chunk size that should be used when
// reading/writing the LOB in chunks.
func (lv *ExternalLobVar) GetChunkSize() (int, error) {
	var chunkSize C.ub4
	var err error

	if err = lv.Verify(); err != nil {
		return 0, err
	}
	if err = lv.lobVar.environment.CheckStatus(
		C.OCILobGetChunkSize(lv.lobVar.connection.handle,
			lv.lobVar.environment.errorHandle,
			(*C.OCILobLocator)(unsafe.Pointer(&lv.lobVar.dataBytes[lv.pos*lv.lobVar.size])),
			&chunkSize),
		"LobGetChunkSize"); err != nil {
		return 0, err
	}
	return int(chunkSize), nil
}
Пример #2
0
// GetChunkSize returns the chunk size that should be used when
// reading/writing the LOB in chunks.
func (lv *ExternalLobVar) GetChunkSize() (int, error) {
	var chunkSize C.ub4
	var err error

	if err = lv.Verify(); err != nil {
		return 0, errgo.Mask(err)
	}
	if CTrace {
		ctrace("OCILobGetChunk(conn=%p, lob=%x, &size=%p)",
			lv.lobVar.connection.handle, lv.getHandleBytes(), &chunkSize)
	}
	if err = lv.lobVar.environment.CheckStatus(
		C.OCILobGetChunkSize(lv.lobVar.connection.handle,
			lv.lobVar.environment.errorHandle,
			lv.getHandle(), &chunkSize),
		"LobGetChunkSize"); err != nil {
		return 0, errgo.Mask(err)
	}
	return int(chunkSize), nil
}