code: func readBatch(copyTo chan<- []byte, socketRead io.ReadCloser, batchSize int, workSize int) {
  	defer close(copyTo)
  	for {
  		batch := make([]byte, batchSize)
  		size, err := readUntilNullWorkSizeBatch(socketRead, batch, workSize)
  		if size > 0 {
  			if err != nil && workSize != 0 {
  				size -= (size % workSize)
  			}
  			copyTo <- batch[:size]
  		}
  		if err != nil {
  			if err != io.EOF {
  				log.Print("Error encountered in readBatch:", err)
  			}
  			return
  		}
  	}
  }
docs: // this reads in a loop from socketRead putting batchSize bytes of work to copyTo until
  // the socketRead is empty.
  // Batches may be shorter than batchSize if a whole workSize element is all zeros
  // If workSize of zero is passed in, then the entire batchSize will be filled up regardless,
  // unless socketRead returns an error when Read