public static void TestAllocate() { // An IllegalArgumentException will be thrown for negative capacities. tryCatch((Buffer)null, typeof(ArgumentException), () => { LongBuffer.Allocate(-1); }); }
public static void Test() { TestAllocate(); test(0, LongBuffer.Allocate(7 * 1024), false); test(0, LongBuffer.Wrap(new long[7 * 1024], 0, 7 * 1024), false); test(new long[1024]); callReset(LongBuffer.Allocate(10)); putBuffer(); }
private static void bulkPutBuffer(LongBuffer b) { int n = b.Capacity; b.Clear(); LongBuffer c = LongBuffer.Allocate(n + 7); c.Position = (7); for (int i = 0; i < n; i++) { c.Put((long)Ic(i)); } c.Flip(); c.Position = (7); b.Put(c); b.Flip(); }