package com.huawei.hms.common.data; import android.os.Bundle; import com.huawei.hms.support.api.client.Result; import java.util.Iterator; /* loaded from: classes2.dex */ public abstract class AbstractDataBuffer extends Result implements DataBuffer { protected final DataHolder mDataHolder; protected AbstractDataBuffer(DataHolder dataHolder) { this.mDataHolder = dataHolder; } @Override // com.huawei.hms.common.data.DataBuffer @Deprecated public final void close() { release(); } @Override // com.huawei.hms.common.data.DataBuffer public abstract T get(int i); @Override // com.huawei.hms.common.data.DataBuffer public int getCount() { DataHolder dataHolder = this.mDataHolder; if (dataHolder == null) { return 0; } return dataHolder.getCount(); } @Override // com.huawei.hms.common.data.DataBuffer public Bundle getMetadata() { DataHolder dataHolder = this.mDataHolder; if (dataHolder == null) { return null; } return dataHolder.getMetadata(); } @Override // com.huawei.hms.common.data.DataBuffer, java.lang.Iterable public Iterator iterator() { return new DBInnerIter(this); } @Override // com.huawei.hms.common.data.DataBuffer public Iterator singleRefIterator() { return new SingleRefDBInnerIter(this); } @Override // com.huawei.hms.common.data.DataBuffer, com.huawei.hms.common.api.Releasable public void release() { DataHolder dataHolder = this.mDataHolder; if (dataHolder != null) { dataHolder.close(); } } @Override // com.huawei.hms.common.data.DataBuffer @Deprecated public boolean isClosed() { DataHolder dataHolder = this.mDataHolder; if (dataHolder == null) { return true; } return dataHolder.isClosed(); } }