public ProfileAvatarData(Stream inputData, long dataLength, string contentType, IOutputStreamFactory outputStreamFactory) { InputData = inputData; DataLength = dataLength; ContentType = contentType; OutputStreamFactory = outputStreamFactory; }
public static OutputWriter Make(CompilerArguments arguments, string file, IOutputStreamFactory streamFactory) { return(new( TransformerChainFactory.Create(arguments), streamFactory.Make(file) )); }
private async Task <byte[]> UploadAttachment(CancellationToken token, string method, string url, Stream data, long dataSize, IOutputStreamFactory outputStreamFactory, IProgressListener listener) { // buffer payload in memory... MemoryStream tmpStream = new MemoryStream(); DigestingOutputStream outputStream = outputStreamFactory.CreateFor(tmpStream); StreamContent streamContent = new StreamContent(tmpStream); data.CopyTo(outputStream); outputStream.Flush(); tmpStream.Position = 0; // ... and upload it! var request = new HttpRequestMessage(HttpMethod.Put, url) { Content = new StreamContent(tmpStream) }; request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); request.Headers.ConnectionClose = true; HttpClient client = Util.CreateHttpClient(); HttpResponseMessage response = await client.SendAsync(request, token); if (response.StatusCode != HttpStatusCode.OK) { throw new IOException($"Bad response: {response.StatusCode} {await response.Content.ReadAsStringAsync()}"); } return(outputStream.GetTransmittedDigest()); }
public ActiveDirectorySyncJob(ILogger logger, JobElement jobConfig, IActiveDirectoryService activeDirectoryService, IOutputStreamFactory outputStreamFactory) : base(logger, jobConfig) { ActiveDirectoryService = activeDirectoryService; OutputStreamFactory = outputStreamFactory; }
public PushAttachmentData(String contentType, Stream data, long dataSize, IOutputStreamFactory outputStreamFactory, IProgressListener listener) { ContentType = contentType; Data = data; DataSize = dataSize; OutputFactory = outputStreamFactory; Listener = listener; }
private void AddOutputStreamFactory(Type type) { IOutputStreamFactory factory = null; var constructor = type.GetConstructor(Type.EmptyTypes); if (constructor != null) { factory = constructor.Invoke(null) as IOutputStreamFactory; } else if ((constructor = type.GetConstructor(new Type[] { typeof(PeerCast) })) != null) { factory = constructor.Invoke(new object[] { peerCast }) as IOutputStreamFactory; } if (factory != null) { peerCast.OutputStreamFactories.Add(factory); } }
public ProcessStream(ProcessConfiguration config, IOutputStreamFactory outputFactory) { if (config == null) { throw new ArgumentNullException(nameof(config)); } if (outputFactory == null) { throw new ArgumentNullException(nameof(outputFactory)); } if (string.IsNullOrEmpty(config.FileName)) { throw new ArgumentNullException("fileName", "Process filename must be supplied"); } this.config = config; this.outputFactory = outputFactory; }
public DigestingRequestBody(Stream inputStream, IOutputStreamFactory outputStreamFactory, string contentType, long contentLength, IProgressListener?progressListener, CancellationToken?cancellationToken) { this.inputStream = inputStream; this.outputStreamFactory = outputStreamFactory; this.contentType = contentType; this.contentLength = contentLength; this.progressListener = progressListener; if (!cancellationToken.HasValue) { this.cancellationToken = CancellationToken.None; } else { this.cancellationToken = cancellationToken.Value; } }
private void UploadToCdn(string acl, string key, string policy, string algorithm, string credential, string date, string signature, Stream inputData, string contentType, long dataLength, IOutputStreamFactory outputStreamFactory) { SignalUrl signalUrl = GetRandom(SignalConnectionInformation.SignalCdnUrls); string url = signalUrl.Url; string hostHeader = signalUrl.HostHeader; throw new NotImplementedException(); //TODO }