package com.google.android.gms.common.data; import com.google.android.gms.common.internal.Preconditions; import java.util.Iterator; import java.util.NoSuchElementException; /* loaded from: classes.dex */ public class DataBufferIterator implements Iterator { protected final DataBuffer zaa; protected int zab = -1; public DataBufferIterator(DataBuffer dataBuffer) { this.zaa = (DataBuffer) Preconditions.checkNotNull(dataBuffer); } @Override // java.util.Iterator public final boolean hasNext() { return this.zab < this.zaa.getCount() - 1; } @Override // java.util.Iterator public T next() { if (!hasNext()) { int i = this.zab; StringBuilder sb = new StringBuilder(46); sb.append("Cannot advance the iterator beyond "); sb.append(i); throw new NoSuchElementException(sb.toString()); } DataBuffer dataBuffer = this.zaa; int i2 = this.zab + 1; this.zab = i2; return dataBuffer.get(i2); } @Override // java.util.Iterator public final void remove() { throw new UnsupportedOperationException("Cannot remove elements from a DataBufferIterator"); } }