Home
last modified time | relevance | path

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

1234

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
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 …]
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 …]
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 …]
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.java57 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
59 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArray()
60 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
62 loadTestData2(array, buf.arrayOffset(), buf.capacity()); in testArray()
63 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
66 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
69 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArray()
95 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset()
97 loadTestData1(array, buf.arrayOffset(), buf.capacity()); in testArrayOffset()
98 assertContentEquals(buf, array, buf.arrayOffset(), buf.capacity()); in testArrayOffset()
[all …]
/libcore/luni/src/main/java/java/nio/
DBuffer.java56 final int capacity; field in Buffer
91 Buffer(int elementSizeShift, int capacity, long effectiveDirectAddress) { in Buffer() argument
93 if (capacity < 0) { in Buffer()
94 throw new IllegalArgumentException("capacity < 0: " + capacity); in Buffer()
96 this.capacity = this.limit = capacity; in Buffer()
141 public final int capacity() { in capacity() method in Buffer
142 return capacity; in capacity()
211 limit = capacity; in clear()
297 if (newLimit < 0 || newLimit > capacity) { in limit()
298 … throw new IllegalArgumentException("Bad limit (capacity " + capacity + "): " + newLimit); in limit()
[all …]
DByteBuffer.java52 public static ByteBuffer allocate(int capacity) { in allocate() argument
53 if (capacity < 0) { in allocate()
54 throw new IllegalArgumentException("capacity < 0: " + capacity); in allocate()
56 return new ByteArrayBuffer(new byte[capacity]); in allocate()
68 public static ByteBuffer allocateDirect(int capacity) { in allocateDirect() argument
69 if (capacity < 0) { in allocateDirect()
70 throw new IllegalArgumentException("capacity < 0: " + capacity); in allocateDirect()
73 MemoryBlock memoryBlock = MemoryBlock.allocate(capacity + 7); in allocateDirect()
76 … return new DirectByteBuffer(memoryBlock, capacity, (int)(alignedAddress - address), false, null); in allocateDirect()
119 ByteBuffer(int capacity, long effectiveDirectAddress) { in ByteBuffer() argument
[all …]
DLongBuffer.java47 public static LongBuffer allocate(int capacity) { in allocate() argument
48 if (capacity < 0) { in allocate()
49 throw new IllegalArgumentException("capacity < 0: " + capacity); in allocate()
51 return new LongArrayBuffer(new long[capacity]); in allocate()
94 LongBuffer(int capacity, long effectiveDirectAddress) { in LongBuffer() argument
95 super(3, capacity, effectiveDirectAddress); in LongBuffer()
DShortBuffer.java47 public static ShortBuffer allocate(int capacity) { in allocate() argument
48 if (capacity < 0) { in allocate()
49 throw new IllegalArgumentException("capacity < 0: " + capacity); in allocate()
51 return new ShortArrayBuffer(new short[capacity]); in allocate()
94 ShortBuffer(int capacity, long effectiveDirectAddress) { in ShortBuffer() argument
95 super(1, capacity, effectiveDirectAddress); in ShortBuffer()
DIntBuffer.java45 public static IntBuffer allocate(int capacity) { in allocate() argument
46 if (capacity < 0) { in allocate()
47 throw new IllegalArgumentException("capacity < 0: " + capacity); in allocate()
49 return new IntArrayBuffer(new int[capacity]); in allocate()
92 IntBuffer(int capacity, long effectiveDirectAddress) { in IntBuffer() argument
93 super(2, capacity, effectiveDirectAddress); in IntBuffer()
DDoubleBuffer.java48 public static DoubleBuffer allocate(int capacity) { in allocate() argument
49 if (capacity < 0) { in allocate()
50 throw new IllegalArgumentException("capacity < 0: " + capacity); in allocate()
52 return new DoubleArrayBuffer(new double[capacity]); in allocate()
95 DoubleBuffer(int capacity, long effectiveDirectAddress) { in DoubleBuffer() argument
96 super(3, capacity, effectiveDirectAddress); in DoubleBuffer()
DFloatBuffer.java47 public static FloatBuffer allocate(int capacity) { in allocate() argument
48 if (capacity < 0) { in allocate()
49 throw new IllegalArgumentException("capacity < 0: " + capacity); in allocate()
51 return new FloatArrayBuffer(new float[capacity]); in allocate()
96 FloatBuffer(int capacity, long effectiveDirectAddress) { in FloatBuffer() argument
97 super(2, capacity, effectiveDirectAddress); in FloatBuffer()
DLongArrayBuffer.java35 private LongArrayBuffer(int capacity, long[] backingArray, int arrayOffset, boolean isReadOnly) { in LongArrayBuffer() argument
36 super(capacity, 0); in LongArrayBuffer()
43 …LongArrayBuffer buf = new LongArrayBuffer(other.capacity(), other.backingArray, other.arrayOffset,… in copy()
60 limit = capacity; in compact()
DFloatArrayBuffer.java35 …private FloatArrayBuffer(int capacity, float[] backingArray, int arrayOffset, boolean isReadOnly) { in FloatArrayBuffer() argument
36 super(capacity, 0); in FloatArrayBuffer()
43 …FloatArrayBuffer buf = new FloatArrayBuffer(other.capacity(), other.backingArray, other.arrayOffse… in copy()
61 limit = capacity; in compact()
DDoubleArrayBuffer.java35 …private DoubleArrayBuffer(int capacity, double[] backingArray, int arrayOffset, boolean isReadOnly… in DoubleArrayBuffer() argument
36 super(capacity, 0); in DoubleArrayBuffer()
43 …DoubleArrayBuffer buf = new DoubleArrayBuffer(other.capacity(), other.backingArray, other.arrayOff… in copy()
60 limit = capacity; in compact()
/libcore/luni/src/main/java/java/util/
DLinkedHashSet.java54 public LinkedHashSet(int capacity) { in LinkedHashSet() argument
55 super(new LinkedHashMap<E, HashSet<E>>(capacity)); in LinkedHashSet()
67 public LinkedHashSet(int capacity, float loadFactor) { in LinkedHashSet() argument
68 super(new LinkedHashMap<E, HashSet<E>>(capacity, loadFactor)); in LinkedHashSet()
88 HashMap<E, HashSet<E>> createBackingMap(int capacity, float loadFactor) { in createBackingMap() argument
89 return new LinkedHashMap<E, HashSet<E>>(capacity, loadFactor); in createBackingMap()
DHashSet.java49 public HashSet(int capacity) { in HashSet() argument
50 this(new HashMap<E, HashSet<E>>(capacity)); in HashSet()
62 public HashSet(int capacity, float loadFactor) { in HashSet() argument
63 this(new HashMap<E, HashSet<E>>(capacity, loadFactor)); in HashSet()
210 HashMap<E, HashSet<E>> createBackingMap(int capacity, float loadFactor) { in createBackingMap() argument
211 return new HashMap<E, HashSet<E>>(capacity, loadFactor); in createBackingMap()
DHashMap.java138 public HashMap(int capacity) { in HashMap() argument
139 if (capacity < 0) { in HashMap()
140 throw new IllegalArgumentException("Capacity: " + capacity); in HashMap()
143 if (capacity == 0) { in HashMap()
151 if (capacity < MINIMUM_CAPACITY) { in HashMap()
152 capacity = MINIMUM_CAPACITY; in HashMap()
153 } else if (capacity > MAXIMUM_CAPACITY) { in HashMap()
154 capacity = MAXIMUM_CAPACITY; in HashMap()
156 capacity = Collections.roundUpToPowerOfTwo(capacity); in HashMap()
158 makeTable(capacity); in HashMap()
[all …]
DHashtable.java117 public Hashtable(int capacity) { in Hashtable() argument
118 if (capacity < 0) { in Hashtable()
119 throw new IllegalArgumentException("Capacity: " + capacity); in Hashtable()
122 if (capacity == 0) { in Hashtable()
130 if (capacity < MINIMUM_CAPACITY) { in Hashtable()
131 capacity = MINIMUM_CAPACITY; in Hashtable()
132 } else if (capacity > MAXIMUM_CAPACITY) { in Hashtable()
133 capacity = MAXIMUM_CAPACITY; in Hashtable()
135 capacity = Collections.roundUpToPowerOfTwo(capacity); in Hashtable()
137 makeTable(capacity); in Hashtable()
[all …]
/libcore/luni/src/main/java/libcore/io/
DIoUtils.java214 int capacity; in FileReader() local
219 capacity = (int) stat.st_size; in FileReader()
220 if (capacity == 0) { in FileReader()
222 capacity = 8192; in FileReader()
229 bytes = new byte[capacity]; in FileReader()
234 int capacity = bytes.length; in readFully() local
236 while ((read = Libcore.os.read(fd, bytes, count, capacity - count)) != 0) { in readFully()
238 if (count == capacity) { in readFully()
242 final int newCapacity = capacity * 2; in readFully()
244 System.arraycopy(bytes, 0, newBytes, 0, capacity); in readFully()
[all …]
DStrictLineReader.java80 public StrictLineReader(InputStream in, int capacity) { in StrictLineReader() argument
81 this(in, capacity, StandardCharsets.US_ASCII); in StrictLineReader()
108 public StrictLineReader(InputStream in, int capacity, Charset charset) { in StrictLineReader() argument
114 if (capacity < 0) { in StrictLineReader()
124 buf = new byte[capacity]; in StrictLineReader()
/libcore/luni/src/main/java/java/util/concurrent/
DLinkedBlockingQueue.java105 private final int capacity; field in LinkedBlockingQueue
228 public LinkedBlockingQueue(int capacity) { in LinkedBlockingQueue() argument
229 if (capacity <= 0) throw new IllegalArgumentException(); in LinkedBlockingQueue()
230 this.capacity = capacity; in LinkedBlockingQueue()
253 if (n == capacity) in LinkedBlockingQueue()
289 return capacity - count.get(); in remainingCapacity()
317 while (count.get() == capacity) { in put()
322 if (c + 1 < capacity) in put()
350 while (count.get() == capacity) { in offer()
357 if (c + 1 < capacity) in offer()
[all …]

1234