code: func readUntilNullWorkSizeBatch(socketRead io.ReadCloser,
  	batch []byte, workSize int) (size int, err error) {
  	err = nil
  	size = 0
  	if workSize == 0 {
  		size, err = io.ReadFull(socketRead, batch)
  	} else {
  		lastCheckedForNull := 0
  		for err == nil {
  			var offset int
  			offset, err = socketRead.Read(batch[size:])
  			size += offset
  			if err == nil && size < len(batch) {
  				endCheck := size - (size % workSize)
  				if zeroWorkItem(batch[lastCheckedForNull:endCheck], workSize) {
  					if size%workSize != 0 {
  						rem := workSize - (size % workSize)
  						offset, err = io.ReadFull(socketRead, batch[size:size+rem])
  						size += offset
  					}
  					return
  				}
  				lastCheckedForNull = endCheck // need to check partial work items
  			} else {
  				return
  			}
  		}
  	}
  	return
  }
docs: // this reads socketRead to fill up the given buffer unless an error is encountered or
  // workSize zeros in a row are discovered, aligned with WorkSize, causing a flush