Home
last modified time | relevance | path

Searched refs:count (Results 1 – 25 of 183) sorted by relevance

12345678

/libcore/luni/src/main/java/java/lang/
DUnsafeByteSequence.java33 private int count; field in UnsafeByteSequence
40 return count; in size()
48 count = 0; in rewind()
52 if (count + length >= bytes.length) { in write()
53 byte[] newBytes = new byte[(count + length) * 2]; in write()
54 System.arraycopy(bytes, 0, newBytes, 0, count); in write()
57 System.arraycopy(buffer, offset, bytes, count, length); in write()
58 count += length; in write()
62 if (count == bytes.length) { in write()
63 byte[] newBytes = new byte[count * 2]; in write()
[all …]
DAbstractStringBuilder.java39 private int count; field in AbstractStringBuilder
71 count = len; in set()
86 count = string.length(); in AbstractStringBuilder()
88 value = new char[count + INITIAL_CAPACITY]; in AbstractStringBuilder()
89 string._getChars(0, count, value, 0); in AbstractStringBuilder()
95 System.arraycopy(value, 0, newData, 0, count); in enlargeBuffer()
101 int newCount = count + 4; in appendNull()
105 value[count++] = 'n'; in appendNull()
106 value[count++] = 'u'; in appendNull()
107 value[count++] = 'l'; in appendNull()
[all …]
DString.java110 private final int count; field in String
120 count = 0; in String()
129 value = new char[s.count + 1]; in String()
130 count = s.count + 1; in String()
131 System.arraycopy(s.value, s.offset, value, 0, s.count); in String()
132 value[s.count] = c; in String()
175 this.count = cb.length(); in String()
177 if (count > 0) { in String()
202 this.count = byteCount; in String()
204 for (int i = 0; i < count; i++) { in String()
[all …]
/libcore/support/src/test/java/tests/support/
DSupport_StringReader.java30 private int count; field in Support_StringReader
43 this.count = str.length(); in Support_StringReader()
121 if (pos != count) { in read()
148 public int read(char buf[], int offset, int count) throws IOException { in read() argument
150 if (0 <= offset && offset <= buf.length && 0 <= count in read()
151 && count <= buf.length - offset) { in read()
154 if (pos == this.count) { in read()
157 int end = pos + count > this.count ? this.count : pos in read()
158 + count; in read()
228 public long skip(long count) throws IOException { in skip() argument
[all …]
DSupport_StringWriter.java113 public void write(char[] buf, int offset, int count) { in write() argument
115 if (0 <= offset && offset <= buf.length && 0 <= count in write()
116 && count <= buf.length - offset) { in write()
118 this.buf.append(buf, offset, count); in write()
172 public void write(String str, int offset, int count) { in write() argument
173 String sub = str.substring(offset, offset + count); in write()
/libcore/luni/src/main/java/java/io/
DCharArrayWriter.java40 protected int count; field in CharArrayWriter
80 if (count + i <= buf.length) { in expand()
84 int newLen = Math.max(2 * buf.length, count + i); in expand()
86 System.arraycopy(buf, 0, newbuf, 0, count); in expand()
105 count = 0; in reset()
118 return count; in size()
131 char[] result = new char[count]; in toCharArray()
132 System.arraycopy(buf, 0, result, 0, count); in toCharArray()
147 return new String(buf, 0, count); in toString()
170 System.arraycopy(buffer, offset, this.buf, this.count, len); in write()
[all …]
DByteArrayOutputStream.java39 protected int count; field in ByteArrayOutputStream
87 if (count + i <= buf.length) { in expand()
91 byte[] newbuf = new byte[(count + i) * 2]; in expand()
92 System.arraycopy(buf, 0, newbuf, 0, count); in expand()
102 count = 0; in reset()
111 return count; in size()
122 byte[] newArray = new byte[count]; in toByteArray()
123 System.arraycopy(buf, 0, newArray, 0, count); in toByteArray()
137 return new String(buf, 0, count); in toString()
175 return new String(buf, 0, count, enc); in toString()
[all …]
DBufferedWriter.java184 public void write(char[] cbuf, int offset, int count) throws IOException { in write() argument
190 Arrays.checkOffsetAndCount(cbuf.length, offset, count); in write()
191 if (pos == 0 && count >= this.buf.length) { in write()
192 out.write(cbuf, offset, count); in write()
196 if (count < available) { in write()
197 available = count; in write()
206 if (count > available) { in write()
208 available = count - available; in write()
264 public void write(String str, int offset, int count) throws IOException { in write() argument
267 if (count <= 0) { in write()
[all …]
DBufferedOutputStream.java47 protected int count; field in BufferedOutputStream
138 if (length > (internalBuffer.length - count)) { in write()
142 System.arraycopy(buffer, offset, internalBuffer, count, length); in write()
143 count += length; in write()
173 if (count == buf.length) { in write()
174 out.write(buf, 0, count); in write()
175 count = 0; in write()
177 buf[count++] = (byte) oneByte; in write()
184 if (count > 0) { in flushInternal()
185 out.write(buf, 0, count); in flushInternal()
[all …]
DByteArrayInputStream.java48 protected int count; field in ByteArrayInputStream
60 this.count = buf.length; in ByteArrayInputStream()
79 count = offset + length > buf.length ? buf.length : offset + length; in ByteArrayInputStream()
89 return count - pos; in available()
141 return pos < count ? buf[pos++] & 0xFF : -1; in read()
170 if (this.pos >= this.count) { in read()
177 int copylen = this.count - pos < length ? this.count - pos : length; in read()
209 pos = this.count - pos < byteCount ? this.count : (int) (pos + byteCount);
DStringBufferInputStream.java38 protected int count; field in StringBufferInputStream
60 count = str.length(); in StringBufferInputStream()
65 return count - pos; in available()
78 return pos < count ? buffer.charAt(pos++) & 0xFF : -1; in read()
111 int copylen = count - pos < length ? count - pos : length; in read()
142 if (this.count - pos < charCount) {
143 numskipped = this.count - pos;
144 pos = this.count;
DCharArrayReader.java46 protected int count; field in CharArrayReader
58 this.count = buf.length; in CharArrayReader()
92 this.count = offset + length < bufferLength ? length : bufferLength; in CharArrayReader()
179 if (pos == count) {
213 if (pos < this.count) {
214 int bytesRead = pos + len > this.count ? this.count - pos : len;
239 return pos != count;
277 if (charCount < this.count - pos) {
281 skipped = this.count - pos;
282 pos = this.count;
DPipedReader.java231 public synchronized int read(char[] buffer, int offset, int count) throws IOException { in read() argument
238 Arrays.checkOffsetAndCount(buffer.length, offset, count); in read()
239 if (count == 0) { in read()
270 copyLength = count > this.buffer.length - out ? this.buffer.length - out : count; in read()
287 if (copyLength == count || in == -1) { in read()
293 copyLength = in - out > count - copyLength ? count - copyLength : in - out; in read()
390 synchronized void receive(char[] chars, int offset, int count) throws IOException { in receive() argument
391 Arrays.checkOffsetAndCount(chars.length, offset, count); in receive()
404 while (count > 0) { in receive()
424 if (count < length) { in receive()
[all …]
DBufferedInputStream.java47 protected int count; field in BufferedInputStream
114 return count - pos + localIn.available(); in available()
146 count = result == -1 ? 0 : result; in fillbuf()
167 count = markpos = 0; in fillbuf()
169 count = bytesread <= 0 ? pos : pos + bytesread; in fillbuf()
227 if (pos >= count && fillbuf(localIn, localBuf) == -1) { in read()
239 if (count - pos > 0) { in read()
283 if (pos < count) { in read()
285 int copylength = count - pos >= byteCount ? byteCount : count - pos; in read()
320 read = count - pos >= required ? required : count - pos; in read()
[all …]
DWriter.java113 public abstract void write(char[] buf, int offset, int count) throws IOException; in write() argument
160 public void write(String str, int offset, int count) throws IOException { in write() argument
161 if ((offset | count) < 0 || offset > str.length() - count) { in write()
162 throw new StringIndexOutOfBoundsException(str, offset, count); in write()
164 char[] buf = new char[count]; in write()
165 str.getChars(offset, offset + count, buf, 0); in write()
DStringReader.java35 private int count; field in StringReader
47 this.count = str.length(); in StringReader()
126 if (pos != count) { in read()
162 if (pos == this.count) { in read()
165 int end = pos + len > this.count ? this.count : pos + len; in read()
236 int maxSkip = count - pos; in skip()
DBufferedReader.java157 int count = in.read(buf, pos, buf.length - pos); in fillBuf() local
158 if (count != -1) { in fillBuf()
159 end += count; in fillBuf()
161 return count; in fillBuf()
284 int count = available >= outstanding ? outstanding : available; in read() local
285 System.arraycopy(buf, pos, buffer, offset, count); in read()
286 pos += count; in read()
287 offset += count; in read()
288 outstanding -= count; in read()
310 int count = in.read(buffer, offset, outstanding); in read() local
[all …]
/libcore/luni/src/main/java/java/nio/charset/
DModifiedUtf8.java36 int count = 0, s = 0, a; in decode() local
37 while (count < utfSize) { in decode()
38 if ((out[s] = (char) in[offset + count++]) < '\u0080') { in decode()
41 if (count >= utfSize) { in decode()
42 throw new UTFDataFormatException("bad second byte at " + count); in decode()
44 int b = in[offset + count++]; in decode()
46 throw new UTFDataFormatException("bad second byte at " + (count - 1)); in decode()
50 if (count + 1 >= utfSize) { in decode()
51 throw new UTFDataFormatException("bad third byte at " + (count + 1)); in decode()
53 int b = in[offset + count++]; in decode()
[all …]
/libcore/dalvik/src/main/java/dalvik/system/profiler/
DDalvikThreadSampler.java40 int count = VMStack.fillStackTraceElements(thread, mutableStackTraceElements[depth]); in getStackTrace() local
41 if (count == 0) { in getStackTrace()
44 if (count < depth) { in getStackTrace()
46 mutableStackTraceElements[count], 0, in getStackTrace()
47 count); in getStackTrace()
49 return mutableStackTraceElements[count]; in getStackTrace()
DAsciiHprofWriter.java60 int count = sample.count; in write() local
61 total += count; in write()
79 int count = sample.count; in write() local
80 double self = (double)count/(double)total; in write()
85 rank, self*100, accum*100, count, stackTrace.stackTraceId, in write()
96 return s2.count - s1.count;
/libcore/luni/src/main/java/java/util/concurrent/
DArrayBlockingQueue.java67 int count; field in ArrayBlockingQueue
126 ++count; in insert()
139 --count; in extract()
169 --count; in removeAt()
235 count = i; in ArrayBlockingQueue()
271 if (count == items.length) in offer()
294 while (count == items.length) in put()
318 while (count == items.length) { in offer()
334 return (count == 0) ? null : extract(); in poll()
344 while (count == 0) in take()
[all …]
DLinkedBlockingQueue.java109 private final AtomicInteger count = new AtomicInteger(0); field in LinkedBlockingQueue
259 count.set(n); in LinkedBlockingQueue()
274 return count.get(); in size()
291 return capacity - count.get(); in remainingCapacity()
308 final AtomicInteger count = this.count; in put() local
319 while (count.get() == capacity) { in put()
323 c = count.getAndIncrement(); in put()
349 final AtomicInteger count = this.count; in offer() local
352 while (count.get() == capacity) { in offer()
358 c = count.getAndIncrement(); in offer()
[all …]
/libcore/luni/src/main/java/libcore/net/http/
DFixedLengthOutputStream.java35 @Override public void write(byte[] buffer, int offset, int count) throws IOException { in write() argument
37 Arrays.checkOffsetAndCount(buffer.length, offset, count); in write()
38 if (count > bytesRemaining) { in write()
39 throw new IOException("expected " + bytesRemaining + " bytes but received " + count); in write()
41 socketOut.write(buffer, offset, count); in write()
42 bytesRemaining -= count; in write()
/libcore/luni/src/main/java/java/text/
DSimpleDateFormat.java285 int next, last = -1, count = 0; in validatePattern() local
291 if (count > 0) { in validatePattern()
293 count = 0; in validatePattern()
306 count++; in validatePattern()
308 if (count > 0) { in validatePattern()
312 count = 1; in validatePattern()
315 if (count > 0) { in validatePattern()
317 count = 0; in validatePattern()
322 if (count > 0) { in validatePattern()
535 int next, last = -1, count = 0; in formatImpl() local
[all …]
/libcore/luni/src/test/java/libcore/java/util/zip/
DGZIPInputStreamTest.java52 long count; in testSkip() local
54 count = in.skip(Long.MAX_VALUE); in testSkip()
55 totalSkipped += count; in testSkip()
56 } while (count > 0); in testSkip()
66 int count; in gunzip() local
67 while ((count = in.read(buffer)) != -1) { in gunzip()
68 out.write(buffer, 0, count); in gunzip()

12345678