docs: @Override
  	public T next(T target) throws IOException {
  		// check for the left over element
  		if (this.readPhase) {
  			return getNextRecord(target);
  		} else {
  			// writing phase. check for leftover first
  			if (this.leftOverReturned) {
  				// get next record
  				if ((target = this.input.next(target)) != null) {
  					if (writeNextRecord(target)) {
  						return target;
  					} else {
  						// did not fit into memory, keep as leftover
  						this.leftOverRecord = this.serializer.copy(target, this.leftOverRecord);
  						this.leftOverReturned = false;
  						this.fullWriteBuffer = true;
  						return null;
  					}
  				} else {
  					this.noMoreBlocks = true;
  					return null;
  				}
  			} else if (this.fullWriteBuffer) {
  				return null;
  			} else {
  				this.leftOverReturned = true;
  				target = this.serializer.copy(this.leftOverRecord, target);
  				return target;
  			}
  		}
  	}