code: func wrapStreamRegistrationCallback(reg streamRegistrationCallback) streamRegistrationCallback {
  	if reg == nil {
  		return reg
  	}
  	return func(desc *logpb.LogStreamDescriptor) bundler.StreamChunkCallback {
  		cb := reg(desc)
  		switch desc.StreamType {
  		case logpb.StreamType_TEXT:
  			return buffered_callback.GetWrappedTextCallback(cb)
  		case logpb.StreamType_DATAGRAM:
  			return buffered_callback.GetWrappedDatagramCallback(cb)
  		default:
  			return cb
  		}
  	}
  }
docs: // wrapStreamRegistrationCallback wraps the given callback to dispatch on the correct stream type.