* Replaced most CSJ2K Array.Copy() calls with the faster Buffer.BlockCopy() for a ~17% speedup (LIBOMV-861)
git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3411 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -113,7 +113,7 @@ namespace CSJ2K.j2k.entropy.encoder
|
||||
// Resize buffer
|
||||
byte[] tmpbuf = buf;
|
||||
buf = new byte[buf.Length + BUF_INC];
|
||||
Array.Copy(tmpbuf, 0, buf, 0, count);
|
||||
Buffer.BlockCopy(tmpbuf, 0, buf, 0, count);
|
||||
}
|
||||
buf[count++] = (byte) b;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ namespace CSJ2K.j2k.entropy.encoder
|
||||
public virtual void toByteArray(int off, int len, byte[] outbuf, int outoff)
|
||||
{
|
||||
// Copy the data
|
||||
Array.Copy(buf, off, outbuf, outoff, len);
|
||||
Buffer.BlockCopy(buf, off, outbuf, outoff, len);
|
||||
}
|
||||
|
||||
/// <summary> Returns the number of valid bytes in the output buffer (count class
|
||||
|
||||
Reference in New Issue
Block a user