/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/ |
D | ShortBufferTest.java | 51 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 53 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 54 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 56 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 57 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 60 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 63 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 68 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 70 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 71 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | FloatBufferTest.java | 52 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 54 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 57 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 58 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 61 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 64 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 69 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 71 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 72 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | LongBufferTest.java | 52 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 54 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 57 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 58 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 61 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 64 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 69 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 71 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 72 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | IntBufferTest.java | 52 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 54 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 57 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 58 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 61 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 64 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 69 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 71 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 72 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | DoubleBufferTest.java | 76 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 78 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 79 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 81 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 82 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 85 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 88 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 93 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 95 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 96 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | CharBufferTest.java | 55 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 57 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 58 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 60 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 61 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 64 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 67 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 72 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 74 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() 75 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset() [all …]
|
D | AbstractBufferTest.java | 43 && baseBuf.limit() <= baseBuf.capacity()); in testCapacity() 54 assertEquals(baseBuf.limit(), baseBuf.capacity()); in testClear() 111 && baseBuf.limit() <= baseBuf.capacity()); 126 baseBuf.limit(baseBuf.capacity()); 127 assertEquals(baseBuf.limit(), baseBuf.capacity()); 133 if (baseBuf.capacity() > 0) { 134 baseBuf.limit(baseBuf.capacity()); 135 baseBuf.position(baseBuf.capacity()); 137 baseBuf.limit(baseBuf.capacity() - 1); 156 baseBuf.limit(baseBuf.capacity() + 1); [all …]
|
D | ByteBufferTest.java | 71 private void checkAllocateDirect(int capacity) { in checkAllocateDirect() argument 72 ByteBuffer b = ByteBuffer.allocateDirect(capacity); in checkAllocateDirect() 73 assertEquals(capacity, b.capacity()); in checkAllocateDirect() 75 assertEquals(capacity, b.limit()); in checkAllocateDirect() 76 assertContentEquals(b, new byte[capacity], 0, capacity); in checkAllocateDirect() 87 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 89 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray() 90 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() 92 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray() 93 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray() [all …]
|
D | ReadOnlyCharBufferTest.java | 114 buf.put(new char[buf.capacity() + 1], 0, buf.capacity() + 1); in testPutcharArrayintint() 166 String str = String.valueOf(new char[buf.capacity()]); in testPutStringintint() 185 String longStr = String.valueOf(new char[buf.capacity()+1]); in testPutStringintint()
|
/libcore/ojluni/src/main/java/java/nio/ |
D | Buffer.java | 190 private int capacity; field in Buffer 212 this.capacity = cap; in Buffer() 230 public final int capacity() { in capacity() method in Buffer 231 return capacity; in capacity() 289 if ((newLimit > capacity) || (newLimit < 0)) in limit() 345 limit = capacity; in clear() 577 capacity = 0; in truncate()
|
D | MappedByteBuffer.java | 119 return (long)capacity() + mappingOffset; in mappingLength() 142 if ((address == 0) || (capacity() == 0)) in isLoaded() 164 if ((address == 0) || (capacity() == 0)) in load() 208 if ((address != 0) && (capacity() != 0)) { in force()
|
D | ByteBuffer.java | 255 public static ByteBuffer allocateDirect(int capacity) { in allocateDirect() argument 258 DirectByteBuffer.MemoryRef memoryRef = new DirectByteBuffer.MemoryRef(capacity); in allocateDirect() 259 return new DirectByteBuffer(capacity, memoryRef); in allocateDirect() 279 public static ByteBuffer allocate(int capacity) { in allocate() argument 280 if (capacity < 0) in allocate() 282 return new HeapByteBuffer(capacity, capacity); in allocate() 915 sb.append(capacity()); in toString()
|
D | LongBuffer.java | 142 public static LongBuffer allocate(int capacity) { in allocate() argument 143 if (capacity < 0) in allocate() 145 return new HeapLongBuffer(capacity, capacity); in allocate() 732 sb.append(capacity()); in toString()
|
D | IntBuffer.java | 143 public static IntBuffer allocate(int capacity) { in allocate() argument 144 if (capacity < 0) in allocate() 146 return new HeapIntBuffer(capacity, capacity); in allocate() 733 sb.append(capacity()); in toString()
|
D | ShortBuffer.java | 142 public static ShortBuffer allocate(int capacity) { in allocate() argument 143 if (capacity < 0) in allocate() 145 return new HeapShortBuffer(capacity, capacity); in allocate() 732 sb.append(capacity()); in toString()
|
D | DoubleBuffer.java | 142 public static DoubleBuffer allocate(int capacity) { in allocate() argument 143 if (capacity < 0) in allocate() 145 return new HeapDoubleBuffer(capacity, capacity); in allocate() 732 sb.append(capacity()); in toString()
|
D | FloatBuffer.java | 142 public static FloatBuffer allocate(int capacity) { in allocate() argument 143 if (capacity < 0) in allocate() 145 return new HeapFloatBuffer(capacity, capacity); in allocate() 732 sb.append(capacity()); in toString()
|
D | ByteBufferAsCharBuffer.java | 72 capacity(), in duplicate() 82 capacity(), in asReadOnlyBuffer() 148 limit(capacity()); in compact() 193 capacity(), in subSequence()
|
D | HeapCharBuffer.java | 90 this.capacity(), in duplicate() 101 this.capacity(), in asReadOnlyBuffer() 201 limit(capacity()); in compact() 224 capacity(), in subSequence()
|
D | ByteBufferAsIntBuffer.java | 72 capacity(), in duplicate() 82 capacity(), in asReadOnlyBuffer() 144 limit(capacity()); in compact()
|
/libcore/ojluni/src/main/java/java/util/ |
D | HashSet.java | 279 s.writeInt(map.capacity()); in writeObject() 300 int capacity = s.readInt(); in readObject() local 301 if (capacity < 0) { in readObject() 303 capacity); in readObject() 322 capacity = (int) Math.min(size * Math.min(1 / loadFactor, 4.0f), in readObject() 327 new LinkedHashMap<E,Object>(capacity, loadFactor) : in readObject() 328 new HashMap<E,Object>(capacity, loadFactor)); in readObject()
|
/libcore/luni/src/main/java/libcore/io/ |
D | IoUtils.java | 337 int capacity; in FileReader() local 342 capacity = (int) stat.st_size; in FileReader() 343 if (capacity == 0) { in FileReader() 345 capacity = 8192; in FileReader() 352 bytes = new byte[capacity]; in FileReader() 357 int capacity = bytes.length; in readFully() local 359 while ((read = Libcore.os.read(fd, bytes, count, capacity - count)) != 0) { in readFully() 361 if (count == capacity) { in readFully() 365 final int newCapacity = capacity * 2; in readFully() 367 System.arraycopy(bytes, 0, newBytes, 0, capacity); in readFully() [all …]
|
/libcore/ojluni/src/main/java/java/util/concurrent/ |
D | LinkedBlockingQueue.java | 137 private final int capacity; field in LinkedBlockingQueue 260 public LinkedBlockingQueue(int capacity) { in LinkedBlockingQueue() argument 261 if (capacity <= 0) throw new IllegalArgumentException(); in LinkedBlockingQueue() 262 this.capacity = capacity; in LinkedBlockingQueue() 285 if (n == capacity) in LinkedBlockingQueue() 321 return capacity - count.get(); in remainingCapacity() 349 while (count.get() == capacity) { in put() 354 if (c + 1 < capacity) in put() 382 while (count.get() == capacity) { in offer() 389 if (c + 1 < capacity) in offer() [all …]
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | MessageDigestBenchmark.java | 96 SMALL_BUFFER.limit(SMALL_BUFFER.capacity()); in timeSmallByteBuffer() 107 SMALL_DIRECT_BUFFER.limit(SMALL_DIRECT_BUFFER.capacity()); in timeSmallDirectByteBuffer() 118 LARGE_BUFFER.limit(LARGE_BUFFER.capacity()); in timeLargeByteBuffer() 129 LARGE_DIRECT_BUFFER.limit(LARGE_DIRECT_BUFFER.capacity()); in timeLargeDirectByteBuffer() 139 LARGE_BUFFER.position(LARGE_BUFFER.capacity() / 2); in timeSmallChunkOfLargeByteBuffer() 150 LARGE_DIRECT_BUFFER.position(LARGE_DIRECT_BUFFER.capacity() / 2); in timeSmallChunkOfLargeDirectByteBuffer()
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ |
D | WriterTest.java | 106 MockWriter(int capacity) { in MockWriter() argument 107 contents = new char[capacity]; in MockWriter() 108 length = capacity; in MockWriter()
|