* 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:
John Hurliman
2010-08-05 19:18:24 +00:00
parent 77e55fa488
commit 03901afe1e
19 changed files with 47 additions and 47 deletions

View File

@@ -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