diff --git a/microsoft-azure-storage/src/com/microsoft/azure/storage/core/WrappedByteArrayOutputStream.java b/microsoft-azure-storage/src/com/microsoft/azure/storage/core/WrappedByteArrayOutputStream.java index 9627c9c17..edb1d8ec7 100644 --- a/microsoft-azure-storage/src/com/microsoft/azure/storage/core/WrappedByteArrayOutputStream.java +++ b/microsoft-azure-storage/src/com/microsoft/azure/storage/core/WrappedByteArrayOutputStream.java @@ -46,4 +46,14 @@ public void write(int b) throws IOException { this.buffer[this.offset] = (byte) b; this.offset++; } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + if (this.offset + len > this.buffer.length) { + throw new IOException(SR.CONTENT_LENGTH_MISMATCH); + } + + System.arraycopy(b, off, this.buffer, this.offset, len); + this.offset += len; + } }