Home
last modified time | relevance | path

Searched refs:capacity (Results 1 – 25 of 101) sorted by relevance

12345

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
DShortBufferTest.java51 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 …]
DFloatBufferTest.java52 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 …]
DLongBufferTest.java52 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 …]
DIntBufferTest.java52 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 …]
DDoubleBufferTest.java76 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 …]
DCharBufferTest.java55 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 …]
DAbstractBufferTest.java43 && 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 …]
DByteBufferTest.java71 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 …]
DReadOnlyCharBufferTest.java114 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/
DBuffer.java190 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()
DMappedByteBuffer.java119 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()
DByteBuffer.java255 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()
DLongBuffer.java142 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()
DIntBuffer.java143 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()
DShortBuffer.java142 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()
DDoubleBuffer.java142 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()
DFloatBuffer.java142 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()
DByteBufferAsCharBuffer.java72 capacity(), in duplicate()
82 capacity(), in asReadOnlyBuffer()
148 limit(capacity()); in compact()
193 capacity(), in subSequence()
DHeapCharBuffer.java90 this.capacity(), in duplicate()
101 this.capacity(), in asReadOnlyBuffer()
201 limit(capacity()); in compact()
224 capacity(), in subSequence()
DByteBufferAsIntBuffer.java72 capacity(), in duplicate()
82 capacity(), in asReadOnlyBuffer()
144 limit(capacity()); in compact()
/libcore/ojluni/src/main/java/java/util/
DHashSet.java279 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/
DIoUtils.java337 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/
DLinkedBlockingQueue.java137 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/
DMessageDigestBenchmark.java96 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/
DWriterTest.java106 MockWriter(int capacity) { in MockWriter() argument
107 contents = new char[capacity]; in MockWriter()
108 length = capacity; in MockWriter()

12345