forked from fast-pack/CSharpFastPFOR
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJustCopy.cs
More file actions
48 lines (41 loc) · 1.32 KB
/
JustCopy.cs
File metadata and controls
48 lines (41 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* This code is released under the
* Apache License Version 2.0 http://www.apache.org/licenses/.
*
* (c) Daniel Lemire, http://lemire.me/en/
*/
/**
* @author Daniel Lemire
*
*/
using System;
namespace Genbox.CSharpFastPFOR
{
public class JustCopy : IntegerCODEC, SkippableIntegerCODEC
{
public void headlessCompress(int[] @in, IntWrapper inpos, int inlength, int[] @out, IntWrapper outpos)
{
Array.Copy(@in, inpos.get(), @out, outpos.get(), inlength);
inpos.add(inlength);
outpos.add(inlength);
}
public void uncompress(int[] @in, IntWrapper inpos, int inlength, int[] @out, IntWrapper outpos)
{
headlessUncompress(@in, inpos, inlength, @out, outpos, inlength);
}
public void headlessUncompress(int[] @in, IntWrapper inpos, int inlength, int[] @out, IntWrapper outpos, int num)
{
Array.Copy(@in, inpos.get(), @out, outpos.get(), num);
inpos.add(num);
outpos.add(num);
}
public void compress(int[] @in, IntWrapper inpos, int inlength, int[] @out, IntWrapper outpos)
{
headlessCompress(@in, inpos, inlength, @out, outpos);
}
public override string ToString()
{
return nameof(JustCopy);
}
}
}