IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.Java.Externs.java.nio.Bits Class Reference

Static Public Member Functions

static void copyFromShortArray (object src, long srcPos, long dstAddr, long length)
 
static void copyToShortArray (long srcAddr, object dst, long dstPos, long length)
 
static void copyFromIntArray (object src, long srcPos, long dstAddr, long length)
 
static void copyToIntArray (long srcAddr, object dst, long dstPos, long length)
 
static void copyFromLongArray (object src, long srcPos, long dstAddr, long length)
 
static void copyToLongArray (long srcAddr, object dst, long dstPos, long length)
 

Detailed Description

Definition at line 33 of file Bits.cs.

Member Function Documentation

◆ copyFromIntArray()

static void IKVM.Java.Externs.java.nio.Bits.copyFromIntArray ( object src,
long srcPos,
long dstAddr,
long length )
static

Definition at line 96 of file Bits.cs.

97 {
98#if !FIRST_PASS
99 int[] intArray = src as int[];
100 if (intArray != null)
101 {
102 int index = ((int)srcPos) >> 2;
103 while (length > 0)
104 {
105 int v = global::java.lang.Integer.reverseBytes(intArray[index++]);
106 Marshal.WriteInt32((IntPtr)dstAddr, v);
107 dstAddr += 4;
108 length -= 4;
109 }
110 }
111 else
112 {
113 float[] floatArray = (float[])src;
114 int index = ((int)srcPos) >> 2;
115 while (length > 0)
116 {
117 int v = global::java.lang.Integer.reverseBytes(global::java.lang.Float.floatToRawIntBits(floatArray[index++]));
118 Marshal.WriteInt32((IntPtr)dstAddr, v);
119 dstAddr += 4;
120 length -= 4;
121 }
122 }
123#endif
124 }

◆ copyFromLongArray()

static void IKVM.Java.Externs.java.nio.Bits.copyFromLongArray ( object src,
long srcPos,
long dstAddr,
long length )
static

Definition at line 156 of file Bits.cs.

157 {
158#if !FIRST_PASS
159 long[] longArray = src as long[];
160 if (longArray != null)
161 {
162 int index = ((int)srcPos) >> 3;
163 while (length > 0)
164 {
165 long v = global::java.lang.Long.reverseBytes(longArray[index++]);
166 Marshal.WriteInt64((IntPtr)dstAddr, v);
167 dstAddr += 8;
168 length -= 8;
169 }
170 }
171 else
172 {
173 double[] doubleArray = (double[])src;
174 int index = ((int)srcPos) >> 3;
175 while (length > 0)
176 {
177 long v = global::java.lang.Long.reverseBytes(BitConverter.DoubleToInt64Bits(doubleArray[index++]));
178 Marshal.WriteInt64((IntPtr)dstAddr, v);
179 dstAddr += 8;
180 length -= 8;
181 }
182 }
183#endif
184 }

◆ copyFromShortArray()

static void IKVM.Java.Externs.java.nio.Bits.copyFromShortArray ( object src,
long srcPos,
long dstAddr,
long length )
static

Definition at line 36 of file Bits.cs.

37 {
38#if !FIRST_PASS
39 short[] shortArray = src as short[];
40 if (shortArray != null)
41 {
42 int index = ((int)srcPos) >> 1;
43 while (length > 0)
44 {
45 short v = global::java.lang.Short.reverseBytes(shortArray[index++]);
46 Marshal.WriteInt16((IntPtr)dstAddr, v);
47 dstAddr += 2;
48 length -= 2;
49 }
50 }
51 else
52 {
53 char[] charArray = (char[])src;
54 int index = ((int)srcPos) >> 1;
55 while (length > 0)
56 {
57 short v = global::java.lang.Short.reverseBytes((short)charArray[index++]);
58 Marshal.WriteInt16((IntPtr)dstAddr, v);
59 dstAddr += 2;
60 length -= 2;
61 }
62 }
63#endif
64 }

◆ copyToIntArray()

static void IKVM.Java.Externs.java.nio.Bits.copyToIntArray ( long srcAddr,
object dst,
long dstPos,
long length )
static

Definition at line 126 of file Bits.cs.

127 {
128#if !FIRST_PASS
129 int[] intArray = dst as int[];
130 if (intArray != null)
131 {
132 int index = ((int)dstPos) >> 2;
133 while (length > 0)
134 {
135 int v = Marshal.ReadInt32((IntPtr)srcAddr);
136 intArray[index++] = global::java.lang.Integer.reverseBytes(v);
137 srcAddr += 4;
138 length -= 4;
139 }
140 }
141 else
142 {
143 float[] floatArray = (float[])dst;
144 int index = ((int)dstPos) >> 2;
145 while (length > 0)
146 {
147 int v = Marshal.ReadInt32((IntPtr)srcAddr);
148 floatArray[index++] = global::java.lang.Float.intBitsToFloat(global::java.lang.Integer.reverseBytes(v));
149 srcAddr += 4;
150 length -= 4;
151 }
152 }
153#endif
154 }

◆ copyToLongArray()

static void IKVM.Java.Externs.java.nio.Bits.copyToLongArray ( long srcAddr,
object dst,
long dstPos,
long length )
static

Definition at line 186 of file Bits.cs.

187 {
188#if !FIRST_PASS
189 long[] longArray = dst as long[];
190 if (longArray != null)
191 {
192 int index = ((int)dstPos) >> 3;
193 while (length > 0)
194 {
195 long v = Marshal.ReadInt64((IntPtr)srcAddr);
196 longArray[index++] = global::java.lang.Long.reverseBytes(v);
197 srcAddr += 8;
198 length -= 8;
199 }
200 }
201 else
202 {
203 double[] doubleArray = (double[])dst;
204 int index = ((int)dstPos) >> 3;
205 while (length > 0)
206 {
207 long v = Marshal.ReadInt64((IntPtr)srcAddr);
208 doubleArray[index++] = BitConverter.Int64BitsToDouble(global::java.lang.Long.reverseBytes(v));
209 srcAddr += 8;
210 length -= 8;
211 }
212 }
213#endif
214 }

◆ copyToShortArray()

static void IKVM.Java.Externs.java.nio.Bits.copyToShortArray ( long srcAddr,
object dst,
long dstPos,
long length )
static

Definition at line 66 of file Bits.cs.

67 {
68#if !FIRST_PASS
69 short[] shortArray = dst as short[];
70 if (shortArray != null)
71 {
72 int index = ((int)dstPos) >> 1;
73 while (length > 0)
74 {
75 short v = Marshal.ReadInt16((IntPtr)srcAddr);
76 shortArray[index++] = global::java.lang.Short.reverseBytes(v);
77 srcAddr += 2;
78 length -= 2;
79 }
80 }
81 else
82 {
83 char[] charArray = (char[])dst;
84 int index = ((int)dstPos) >> 1;
85 while (length > 0)
86 {
87 short v = Marshal.ReadInt16((IntPtr)srcAddr);
88 charArray[index++] = (char)global::java.lang.Short.reverseBytes(v);
89 srcAddr += 2;
90 length -= 2;
91 }
92 }
93#endif
94 }

The documentation for this class was generated from the following file: