public ChunkHandler WriteChunk(IHttpStreamable httpStream) { byte[] buffer = new byte[ChunkSize]; fileInputStream.Read(buffer, 0, buffer.Length); httpStream.Write(buffer); bytesSent += ChunkSize; chunkId++; return(this); }
private void WriteOctetStreamPart(IHttpStreamable httpStream, bool prepare, string key, byte[] payload) { httpStream.WriteLine("Content-Disposition: form-data; name=\"" + key + "\"; filename=\"blob\""); httpStream.WriteLine("Content-Type: application/octet-stream"); httpStream.WriteLine(); if (!prepare) { httpStream.Write(payload); } httpStream.WriteLine(); httpStream.FlushUnderlying(); }