Пример #1
0
        public ChunkHandler WriteChunk(IHttpStreamable httpStream)
        {
            byte[] buffer = new byte[ChunkSize];
            fileInputStream.Read(buffer, 0, buffer.Length);

            httpStream.Write(buffer);

            bytesSent += ChunkSize;
            chunkId++;
            return(this);
        }
Пример #2
0
        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();
        }