// If we will fill the buffer we need to make it bigger
if(count+length>=buf.length)
buf.resize(max(count+length+1,buf.length*2));
XMemCpy(&buf[count],&b[offset],length);
//std::copy( b->data+offset, b->data+offset+length, buf->data + count ); // Or this instead?
count+=length;
}
//Closing a ByteArrayOutputStream has no effect.
//The methods in this class can be called after the stream has been closed without generating an IOException.
voidByteArrayOutputStream::close()
{
}
//Creates a newly allocated byte array. Its size is the current size of this output stream and the valid contents of the buffer have been copied into it.
//Returns:
//the current contents of this output stream, as a byte array.