Azure/azure-sdk-for-node — pull request #1214 by JonathanSmith (2014-05-17 00:18:06+00:00)
Title: Fixes to ChunkStream sending incorrect size and failing with oob if chunks are the wrong size.

While streaming using createBlob I found two errors in the ChunkStream:

The first was that if the data.length and chunk size (_highWaterMark), were not multiples of each other, you would get an oob when trying to stream to it. (Fixed by using 'copied' instead of 'data.length' to increment the _internalBufferSize in copyToInternalBuffer).

The second was that the first copyToInternalBuffer in _buildChunk was receiving the wrong starting offset after re-syncing the frame, this was fixed by replacing '0' with 'dataOffset'.