Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 447) sorted by relevance

12345678910>>...18

/libcore/benchmarks/src/benchmarks/
DSystemArrayCopyBenchmark.java29 final int len = arrayLength; in timeSystemCharArrayCopy() local
30 char[] src = new char[len]; in timeSystemCharArrayCopy()
31 char[] dst = new char[len]; in timeSystemCharArrayCopy()
33 System.arraycopy(src, 0, dst, 0, len); in timeSystemCharArrayCopy()
38 final int len = arrayLength; in timeSystemByteArrayCopy() local
39 byte[] src = new byte[len]; in timeSystemByteArrayCopy()
40 byte[] dst = new byte[len]; in timeSystemByteArrayCopy()
42 System.arraycopy(src, 0, dst, 0, len); in timeSystemByteArrayCopy()
47 final int len = arrayLength; in timeSystemShortArrayCopy() local
48 short[] src = new short[len]; in timeSystemShortArrayCopy()
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DDerInputBuffer.java49 DerInputBuffer(byte[] buf, int offset, int len) { in DerInputBuffer() argument
50 super(buf, offset, len); in DerInputBuffer()
65 int len = available(); in toByteArray() local
66 if (len <= 0) in toByteArray()
68 byte[] retval = new byte[len]; in toByteArray()
70 System.arraycopy(buf, pos, retval, 0, len); in toByteArray()
127 int len = available(); in hashCode() local
130 for (int i = 0; i < len; i++) in hashCode()
135 void truncate(int len) throws IOException { in truncate() argument
136 if (len > available()) in truncate()
[all …]
/libcore/ojluni/src/main/java/java/util/zip/
DZipInputStream.java208 public int read(byte[] b, int off, int len) throws IOException { in read() argument
210 if (off < 0 || len < 0 || off > b.length - len) { in read()
212 } else if (len == 0) { in read()
221 len = super.read(b, off, len); in read()
222 if (len == -1) { in read()
227 crc.update(b, off, len); in read()
231 remaining -= len; in read()
233 return len; in read()
240 if (len > remaining) { in read()
241 len = (int)remaining; in read()
[all …]
DCheckedInputStream.java81 public int read(byte[] buf, int off, int len) throws IOException { in read() argument
82 len = in.read(buf, off, len); in read()
83 if (len != -1) { in read()
84 cksum.update(buf, off, len); in read()
86 return len; in read()
99 long len = n - total; in skip() local
100 len = read(buf, 0, len < buf.length ? (int)len : buf.length); in skip()
101 if (len == -1) { in skip()
104 total += len; in skip()
DInflaterInputStream.java57 protected int len; field in InflaterInputStream
193 public int read(byte[] b, int off, int len) throws IOException { in read() argument
197 } else if (off < 0 || len < 0 || len > b.length - off) { in read()
199 } else if (len == 0) { in read()
204 while ((n = inf.inflate(b, off, len)) == 0) { in read()
260 int len = max - total; in skip() local
261 if (len > b.length) { in skip()
262 len = b.length; in skip()
264 len = read(b, 0, len); in skip()
265 if (len == -1) { in skip()
[all …]
DDeflaterOutputStream.java199 public void write(byte[] b, int off, int len) throws IOException { in write() argument
203 if ((off | len | (off + len) | (b.length - (off + len))) < 0) { in write()
205 } else if (len == 0) { in write()
209 def.setInput(b, off, len); in write()
266 int len = 0; in deflate() local
267 while ((len = def.deflate(buf, 0, buf.length)) > 0) { in deflate()
268 out.write(buf, 0, len); in deflate()
289 int len = 0; in flush() local
290 while ((len = def.deflate(buf, 0, buf.length, Deflater.SYNC_FLUSH)) > 0) in flush()
292 out.write(buf, 0, len); in flush()
[all …]
DDeflaterInputStream.java152 int len = read(rbuf, 0, 1); in read() local
153 if (len <= 0) in read()
171 public int read(byte[] b, int off, int len) throws IOException { in read() argument
176 } else if (off < 0 || len < 0 || len > b.length - off) { in read()
178 } else if (len == 0) { in read()
184 while (len > 0 && !def.finished()) { in read()
199 n = def.deflate(b, off, len); in read()
202 len -= n; in read()
251 int len = read(rbuf, 0, (total <= rbuf.length ? total : rbuf.length)); in skip() local
253 if (len < 0) { in skip()
[all …]
DCRC32.java73 public void update(byte[] b, int off, int len) { in update() argument
77 if (off < 0 || len < 0 || off > b.length - len) { in update()
80 crc = updateBytes(crc, b, off, len); in update()
150 private static int updateBytes(int crc, byte[] b, int off, int len) { in updateBytes() argument
151 updateBytesCheck(b, off, len); in updateBytes()
152 return updateBytes0(crc, b, off, len); in updateBytes()
156 private static native int updateBytes0(int crc, byte[] b, int off, int len); in updateBytes0() argument
158 private static void updateBytesCheck(byte[] b, int off, int len) { in updateBytesCheck() argument
159 if (len <= 0) { in updateBytesCheck()
169 int endIndex = off + len - 1; in updateBytesCheck()
[all …]
DGZIPOutputStream.java152 public synchronized void write(byte[] buf, int off, int len) in write() argument
155 super.write(buf, off, len); in write()
156 crc.update(buf, off, len); in write()
170 int len = def.deflate(buf, 0, buf.length); in finish() local
171 if (def.finished() && len <= buf.length - TRAILER_SIZE) { in finish()
173 writeTrailer(buf, len); in finish()
174 len = len + TRAILER_SIZE; in finish()
175 out.write(buf, 0, len); in finish()
178 if (len > 0) in finish()
179 out.write(buf, 0, len); in finish()
/libcore/ojluni/src/main/java/sun/util/locale/
DLocaleUtils.java55 int len = s1.length(); in caseIgnoreMatch() local
56 if (len != s2.length()) { in caseIgnoreMatch()
60 for (int i = 0; i < len; i++) { in caseIgnoreMatch()
89 int len = s.length(); in toLowerString() local
91 for (; idx < len; idx++) { in toLowerString()
96 if (idx == len) { in toLowerString()
100 char[] buf = new char[len]; in toLowerString()
101 for (int i = 0; i < len; i++) { in toLowerString()
109 int len = s.length(); in toUpperString() local
111 for (; idx < len; idx++) { in toUpperString()
[all …]
/libcore/ojluni/src/main/java/java/io/
DPushbackInputStream.java162 public int read(byte[] b, int off, int len) throws IOException { in read() argument
166 } else if (off < 0 || len < 0 || len > b.length - off) { in read()
168 } else if (len == 0) { in read()
174 if (len < avail) { in read()
175 avail = len; in read()
180 len -= avail; in read()
182 if (len > 0) { in read()
183 len = super.read(b, off, len); in read()
184 if (len == -1) { in read()
187 return avail + len; in read()
[all …]
DPushbackReader.java107 public int read(char cbuf[], int off, int len) throws IOException { in read() argument
111 if (len <= 0) { in read()
112 if (len < 0) { in read()
121 if (len < avail) in read()
122 avail = len; in read()
126 len -= avail; in read()
128 if (len > 0) { in read()
129 len = super.read(cbuf, off, len); in read()
130 if (len == -1) { in read()
133 return avail + len; in read()
[all …]
DByteArrayInputStream.java172 public synchronized int read(byte b[], int off, int len) { in read() argument
173 Objects.checkFromIndexSize(off, len, b.length); in read()
180 if (len > avail) { in read()
181 len = avail; in read()
183 if (len <= 0) { in read()
186 System.arraycopy(buf, pos, b, off, len); in read()
187 pos += len; in read()
188 return len; in read()
197 public int readNBytes(byte[] b, int off, int len) { in readNBytes() argument
198 int n = read(b, off, len); in readNBytes()
[all …]
DStringBufferInputStream.java112 public synchronized int read(byte b[], int off, int len) { in read() argument
115 } else if ((off < 0) || (off > b.length) || (len < 0) || in read()
116 ((off + len) > b.length) || ((off + len) < 0)) { in read()
124 if (len > avail) { in read()
125 len = avail; in read()
128 if (len <= 0) { in read()
131 buffer.getBytes(pos, pos + len, b, off); in read()
132 pos += len; in read()
133 return len; in read()
DCharArrayReader.java131 public int read(char[] cbuf, int off, int len) throws IOException { in read() argument
134 Objects.checkFromIndexSize(off, len, cbuf.length); in read()
135 if (len == 0) { in read()
144 if (len > avail) { in read()
145 len = avail; in read()
147 if (len <= 0) { in read()
150 System.arraycopy(buf, pos, cbuf, off, len); in read()
151 pos += len; in read()
152 return len; in read()
166 int len = Math.min(avail, target.remaining()); in read() local
[all …]
DInputStream.java108 public int read(byte[] b, int off, int len) throws IOException { in nullInputStream() argument
109 Objects.checkFromIndexSize(off, len, b.length); in nullInputStream()
110 if (len == 0) { in nullInputStream()
124 public int readNBytes(byte[] b, int off, int len) in nullInputStream() argument
126 Objects.checkFromIndexSize(off, len, b.length); in nullInputStream()
132 public byte[] readNBytes(int len) throws IOException { in nullInputStream() argument
133 if (len < 0) { in nullInputStream()
278 public int read(byte b[], int off, int len) throws IOException { in read() argument
279 Objects.checkFromIndexSize(off, len, b.length); in read()
280 if (len == 0) { in read()
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DDatagramDispatcher.java45 int read(FileDescriptor fd, long address, int len) throws IOException { in read() argument
48 return read0(fd, address, len); in read()
51 long readv(FileDescriptor fd, long address, int len) throws IOException { in readv() argument
54 return readv0(fd, address, len); in readv()
57 int write(FileDescriptor fd, long address, int len) throws IOException { in write() argument
60 return write0(fd, address, len); in write()
63 long writev(FileDescriptor fd, long address, int len) throws IOException { in writev() argument
66 return writev0(fd, address, len); in writev()
77 static native int read0(FileDescriptor fd, long address, int len) in read0() argument
80 static native long readv0(FileDescriptor fd, long address, int len) in readv0() argument
[all …]
DFileDispatcherImpl.java46 int read(FileDescriptor fd, long address, int len) throws IOException { in read() argument
49 return read0(fd, address, len); in read()
52 int pread(FileDescriptor fd, long address, int len, long position) in pread() argument
57 return pread0(fd, address, len, position); in pread()
60 long readv(FileDescriptor fd, long address, int len) throws IOException { in readv() argument
63 return readv0(fd, address, len); in readv()
66 int write(FileDescriptor fd, long address, int len) throws IOException { in write() argument
69 return write0(fd, address, len); in write()
72 int pwrite(FileDescriptor fd, long address, int len, long position) in pwrite() argument
77 return pwrite0(fd, address, len, position); in pwrite()
[all …]
DSocketDispatcher.java40 int read(FileDescriptor fd, long address, int len) throws IOException { in read() argument
43 return FileDispatcherImpl.read0(fd, address, len); in read()
46 long readv(FileDescriptor fd, long address, int len) throws IOException { in readv() argument
49 return FileDispatcherImpl.readv0(fd, address, len); in readv()
52 int write(FileDescriptor fd, long address, int len) throws IOException { in write() argument
55 return FileDispatcherImpl.write0(fd, address, len); in write()
58 long writev(FileDescriptor fd, long address, int len) throws IOException { in writev() argument
61 return FileDispatcherImpl.writev0(fd, address, len); in writev()
/libcore/ojluni/src/main/java/java/lang/
DThreadLocal.java363 private void setThreshold(int len) { in setThreshold() argument
364 threshold = len * 2 / 3; in setThreshold()
370 private static int nextIndex(int i, int len) { in nextIndex() argument
371 return ((i + 1 < len) ? i + 1 : 0); in nextIndex()
377 private static int prevIndex(int i, int len) { in prevIndex() argument
378 return ((i - 1 >= 0) ? i - 1 : len - 1); in prevIndex()
402 int len = parentTable.length; in ThreadLocalMap() local
403 setThreshold(len); in ThreadLocalMap()
404 table = new Entry[len]; in ThreadLocalMap()
413 int h = key.threadLocalHashCode & (len - 1); in ThreadLocalMap()
[all …]
/libcore/ojluni/src/main/native/
Dio_util.c68 outOfBounds(JNIEnv *env, jint off, jint len, jbyteArray array) { in outOfBounds() argument
70 (len < 0) || in outOfBounds()
73 ((*env)->GetArrayLength(env, array) - off < len)); in outOfBounds()
78 jint off, jint len, jfieldID fid) in readBytes() argument
90 if (outOfBounds(env, off, len, bytes)) { in readBytes()
95 if (len == 0) { in readBytes()
97 } else if (len > BUF_SIZE) { in readBytes()
98 buf = malloc(len); in readBytes()
112 nread = (jint)IO_Read(fd, buf, len); in readBytes()
154 jint off, jint len, jboolean append, jfieldID fid) in writeBytes() argument
[all …]
/libcore/ojluni/src/test/java/lang/StringBuffer/
DAppendCharSequence.java72 int len = generator.nextInt(100); in bash() local
73 while (index > sb2.length() - len) { in bash()
75 len = generator.nextInt(100); in bash()
77 sb5.append((CharSequence)sb2, index, index + len); in bash() local
78 s5 = s5 + sb2.toString().substring(index, index + len); in bash()
100 len = generator.nextInt(100); in bash()
101 while (index2 > sb4.length() - len) { in bash()
103 len = generator.nextInt(100); in bash()
105 sb5.insert(index1, (CharSequence)sb4, index2, index2 + len); in bash()
107 index2, len).toString(); in bash()
[all …]
/libcore/luni/src/main/native/
DZipUtilities.cpp45 void NativeZipStream::setDictionary(JNIEnv* env, jbyteArray javaDictionary, int off, int len, in setDictionary() argument
47 std::unique_ptr<jbyte[]> dictionaryBytes(new jbyte[len]); in setDictionary()
52 env->GetByteArrayRegion(javaDictionary, off, len, &dictionaryBytes[0]); in setDictionary()
56 err = inflateSetDictionary(&stream, dictionary, len); in setDictionary()
58 err = deflateSetDictionary(&stream, dictionary, len); in setDictionary()
67 void NativeZipStream::setInput(JNIEnv* env, jbyteArray buf, jint off, jint len) { in setInput() argument
68 input.reset(new jbyte[len]); in setInput()
74 inCap = len; in setInput()
76 env->GetByteArrayRegion(buf, off, len, &input[0]); in setInput()
79 stream.avail_in = len; in setInput()
/libcore/ojluni/src/main/java/java/util/jar/
DManifest.java297 int len; in read() local
302 while ((len = fis.readLine(lbuf)) != -1) { in read()
303 byte c = lbuf[--len]; in read()
310 if (len > 0 && lbuf[len-1] == '\r') { in read()
311 --len; in read()
313 if (len == 0 && skipEmptyLines) { in read()
319 name = parseName(lbuf, len); in read()
326 lastline = new byte[len - 6]; in read()
327 System.arraycopy(lbuf, 6, lastline, 0, len - 6); in read()
332 byte[] buf = new byte[lastline.length + len - 1]; in read()
[all …]
/libcore/ojluni/src/test/java/util/zip/
DDeInflate.java44 static void checkStream(Deflater def, byte[] in, int len, in checkStream() argument
53 defos.write(in, 0, len); in checkStream()
63 if (n != len || in checkStream()
64 !Arrays.equals(Arrays.copyOf(in, len), Arrays.copyOf(out2, len)) || in checkStream()
67 m, n, len, Arrays.equals(in, out2)); in checkStream()
74 byte[] expected, int len, byte[] result, in checkByteBuffer() argument
93 if (n != len || out2.position() != len || in checkByteBuffer()
94 !Arrays.equals(Arrays.copyOf(expected, len), Arrays.copyOf(result, len)) || in checkByteBuffer()
138 static void check(Deflater def, byte[] in, int len, boolean nowrap) in check() argument
145 def.setInput(in, 0, len); in check()
[all …]

12345678910>>...18