Searched refs:length (Results 1 - 25 of 1415) sorted by relevance

1234567891011>>

/libcore/benchmarks/src/benchmarks/regression/
H A DStringLengthBenchmark.java21 int length = 0;
23 length = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".length();
25 if (length != 51) throw new RuntimeException();
H A DCharsetBenchmark.java23 private int length; field in class:CharsetBenchmark
42 byte[] bytes = makeBytes(makeString(length));
49 byte[] bytes = makeBytes(makeString(length));
51 new String(bytes, 0, bytes.length);
56 byte[] bytes = makeBytes(makeString(length));
58 new String(bytes, 0, bytes.length, name);
63 String string = makeString(length);
69 private static String makeString(int length) { argument
70 StringBuilder result = new StringBuilder(length);
71 for (int i = 0; i < length;
[all...]
/libcore/ojluni/src/main/java/sun/security/util/
H A DLength.java29 * The Length interface defines the length of an object
34 * Gets the length of this object
37 * the length should be measured in bits.
39 * @return the length of this object
42 public int length(); method in interface:Length
H A DBitArray.java41 private int length; field in class:BitArray
56 public BitArray(int length) throws IllegalArgumentException { argument
57 if (length < 0) {
58 throw new IllegalArgumentException("Negative length for BitArray");
61 this.length = length;
63 repn = new byte[(length + BITS_PER_UNIT - 1)/BITS_PER_UNIT];
72 * 8*a.length <= length.
74 public BitArray(int length, byt argument
156 public int length() { method in class:BitArray
[all...]
H A DByteArrayLexOrder.java55 for (int i = 0; i < bytes1.length && i < bytes2.length; i++) {
63 return bytes1.length - bytes2.length;
/libcore/ojluni/src/main/java/java/net/
H A DDatagramPacket.java69 int length; field in class:DatagramPacket
76 * length {@code length}, specifying an offset into the buffer.
78 * The {@code length} argument must be less than or equal to
79 * {@code buf.length}.
83 * @param length the number of bytes to read.
87 public DatagramPacket(byte buf[], int offset, int length) { argument
88 setData(buf, offset, length);
95 * length {@code length}
103 DatagramPacket(byte buf[], int length) argument
123 DatagramPacket(byte buf[], int offset, int length, InetAddress address, int port) argument
152 DatagramPacket(byte buf[], int offset, int length, SocketAddress address) argument
175 DatagramPacket(byte buf[], int length, InetAddress address, int port) argument
193 DatagramPacket(byte buf[], int length, SocketAddress address) argument
278 setData(byte[] buf, int offset, int length) argument
307 setReceivedLength(int length) argument
401 setLength(int length) argument
[all...]
/libcore/dalvik/src/main/java/dalvik/system/
H A DDalvikLogging.java38 int length = loggerName.length();
39 if (length <= 23) {
44 return length - (lastPeriod + 1) <= 23
46 : loggerName.substring(loggerName.length() - 23);
/libcore/ojluni/src/main/java/java/io/
H A DOptionalDataException.java35 * length field is set to the number of bytes of primitive data
41 * OptionalDataException's eof field is set to true, and the length field
53 * Create an <code>OptionalDataException</code> with a length.
57 length = len;
65 length = 0;
75 public int length; field in class:OptionalDataException
H A DStringReader.java39 private int length; field in class:StringReader
50 this.length = s.length();
70 if (next >= length)
91 if ((off < 0) || (off > cbuf.length) || (len < 0) ||
92 ((off + len) > cbuf.length) || ((off + len) < 0)) {
97 if (next >= length)
99 int n = Math.min(length - next, len);
125 if (next >= length)
128 long n = Math.min(length
[all...]
/libcore/ojluni/src/main/java/sun/misc/
H A DIOUtils.java40 * Read up to <code>length</code> of bytes from <code>in</code>
43 * @param length number of bytes to read, -1 or Integer.MAX_VALUE means
46 * bytes are read. Ignored when length is -1 or Integer.MAX_VALUE
50 public static byte[] readFully(InputStream is, int length, boolean readAll) argument
53 if (length == -1) length = Integer.MAX_VALUE;
55 while (pos < length) {
57 if (pos >= output.length) { // Only expand when there's no room
58 bytesToRead = Math.min(length - pos, output.length
[all...]
/libcore/luni/src/main/java/libcore/internal/
H A DStringPool.java28 private static boolean contentEquals(String s, char[] chars, int start, int length) { argument
29 if (s.length() != length) {
32 for (int i = 0; i < length; i++) {
41 * Returns a string equal to {@code new String(array, start, length)}.
43 public String get(char[] array, int start, int length) { argument
46 for (int i = start; i < start + length; i++) {
53 int index = hashCode & (pool.length - 1);
56 if (pooled != null && contentEquals(pooled, array, start, length)) {
60 String result = new String(array, start, length);
[all...]
/libcore/luni/src/main/java/libcore/util/
H A DCharsetUtils.java32 public static native byte[] toAsciiBytes(String s, int offset, int length); argument
39 public static native byte[] toIsoLatin1Bytes(String s, int offset, int length); argument
46 public static native byte[] toUtf8Bytes(String s, int offset, int length); argument
52 public static byte[] toBigEndianUtf16Bytes(String s, int offset, int length) { argument
53 byte[] result = new byte[length * 2];
54 int end = offset + length;
73 public static native void asciiBytesToChars(byte[] bytes, int offset, int length, char[] chars); argument
83 public static native void isoLatin1BytesToChars(byte[] bytes, int offset, int length, char[] chars); argument
/libcore/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/
H A DChunk.java25 * The "offset" and "length" fields are present so handlers can over-allocate
35 public int offset, length; // position within "data" field in class:Chunk
45 public Chunk(int type, byte[] data, int offset, int length) { argument
49 this.length = length;
61 this.length = buf.position();
/libcore/benchmarks/src/benchmarks/
H A DStringIterationBenchmark.java27 for (int i = 0; i < s.length(); ++i) {
36 for (int i = 0, length = s.length(); i < length; ++i) {
46 for (int i = 0, length = chars.length; i < length; ++i) {
/libcore/luni/src/main/java/org/xml/sax/helpers/
H A DAttributesImpl.java61 length = 0;
95 return length;
109 if (index >= 0 && index < length) {
127 if (index >= 0 && index < length) {
145 if (index >= 0 && index < length) {
163 if (index >= 0 && index < length) {
180 if (index >= 0 && index < length) {
203 int max = length * 5;
222 int max = length * 5;
244 int max = length *
612 int length; field in class:AttributesImpl
[all...]
/libcore/ojluni/src/main/java/java/lang/
H A DCharSequence.java62 * Returns the length of this character sequence. The length is the number
67 int length(); method in interface:CharSequence
71 * to <tt>length() - 1</tt>. The first <code>char</code> value of the sequence is at
85 * <tt>length()</tt>
92 * ends with the <code>char</code> value at index <tt>end - 1</tt>. The length
104 * if <tt>end</tt> is greater than <tt>length()</tt>,
111 * order as this sequence. The length of the string will be the length of
135 return cur < length();
[all...]
/libcore/ojluni/src/main/java/java/nio/charset/
H A DCoderResult.java59 * <tt>true</tt> and whose {@link #length() length} method returns the length
61 * all malformed-input errors of a given length. </p></li>
67 * whose {@link #length() length} method returns the length of the input
69 * of this class for all unmappable-character errors of a given length.
97 private final int length; field in class:CoderResult
99 private CoderResult(int type, int length) { argument
173 public int length() { method in class:CoderResult
235 malformedForLength(int length) argument
254 unmappableForLength(int length) argument
[all...]
/libcore/luni/src/main/java/libcore/io/
H A DNioBufferIterator.java29 private final int length; field in class:NioBufferIterator
34 NioBufferIterator(MemoryMappedFile file, long address, int length, boolean swap) { argument
40 if (length < 0) {
41 throw new IllegalArgumentException("length < 0");
44 if (Long.compareUnsigned(address, MAX_VALID_ADDRESS - length) > 0) {
46 "length " + length + " would overflow 64-bit address space");
48 this.length = length;
67 checkDstBounds(dstOffset, dst.length, byteCoun
107 checkReadBounds(int position, int length, int byteCount) argument
[all...]
/libcore/support/src/test/java/org/apache/harmony/xnet/tests/support/
H A DX509TrustManagerImpl.java12 if(ax509certificate == null || ax509certificate.length == 0)
13 throw new IllegalArgumentException("null or zero-length certificate chain");
14 if(s == null || s.length() == 0)
15 throw new IllegalArgumentException("null or zero-length authentication type");
17 for (int i = 0; i < ax509certificate.length; i++) {
27 if(ax509certificate == null || ax509certificate.length == 0)
28 throw new IllegalArgumentException("null or zero-length certificate chain");
29 if(s == null || s.length() == 0)
30 throw new IllegalArgumentException("null or zero-length authentication type");
32 for (int i = 0; i < ax509certificate.length;
[all...]
/libcore/luni/src/test/java/libcore/java/lang/
H A DStringBuilderTest.java28 sb.deleteCharAt(sb.length() - 1);
56 sb.delete(sb.length() - 3, sb.length());
71 sb.deleteCharAt(sb.length());
89 sb.delete(sb.length(), sb.length() + 2);
90 sb.delete(sb.length(), sb.length());
97 sb.delete(sb.length() + 2, sb.length()
[all...]
/libcore/luni/src/main/java/android/system/
H A DUnixSocketAddress.java34 // 1) pathname: 0 < sun_path.length <= NAMED_PATH_LENGTH, sun_path[0] != 0.
36 // 3) abstract: 0 < sun_path.length <= NAMED_PATH_LENGTH, sun_path[0] == 0.
44 if (sun_path.length > NAMED_PATH_LENGTH) {
45 throw new IllegalArgumentException("sun_path exceeds the maximum length");
48 if (sun_path.length == 0) {
51 this.sun_path = new byte[sun_path.length];
52 System.arraycopy(sun_path, 0, this.sun_path, 0, sun_path.length);
62 byte[] path = new byte[nameBytes.length + 1];
63 System.arraycopy(nameBytes, 0, path, 1, nameBytes.length);
73 byte[] path = new byte[pathNameBytes.length
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
H A DDateFormatSymbolsTest.java121 if (retVal.length != val.length)
123 for (int i = 0; i < val.length; i++)
135 if (retVal.length != val.length)
137 for (int i = 0; i < val.length; i++)
151 assertEquals("Returned wrong array: ", val.length, retVal.length);
152 for (int i = 0; i < val.length; i++)
165 assertEquals("Returned wrong array: ", val.length, retVa
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
H A DByteArrayInputStreamTest.java38 bis.available() == fileString.length());
63 SubByteArrayInputStream(byte[] buf, int offset, int length) argument
65 super(buf, offset, length);
78 .available() == fileString.length());
98 is.read(buf1, 0, buf1.length);
100 is.read(buf2, 0, buf2.length);
103 buf1.length).equals(new String(buf2, 0, buf2.length)));
130 is.read(buf1, 0, buf1.length);
132 buf1.length)
[all...]
/libcore/dom/src/test/java/org/w3c/domts/level1/core/
H A Dhc_nodelistindexgetlength.java67 int length;
72 length = (int) employeeList.getLength();
74 if (equals(6, length)) {
75 assertEquals("length_wo_space", 6, length);
77 assertEquals("length_w_space", 13, length);
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/support/
H A DMyMacSpi.java40 private int length = 0; field in class:MyMacSpi
43 return length;
63 length = len;
69 return new byte[length];
74 length++;

Completed in 892 milliseconds

1234567891011>>