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

1234567891011>>

/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/
H A DFakeInputStream.java28 public FakeInputStream(long length) { argument
29 mRemaining = length;
44 public int read(byte[] buffer, int offset, int length) { argument
45 Arrays.checkOffsetAndCount(buffer.length, offset, length);
47 if (length > mRemaining) {
48 length = (int) mRemaining;
50 mRemaining -= length;
52 if (length == 0) {
55 return length;
[all...]
/packages/apps/Bluetooth/src/com/android/bluetooth/util/
H A DNumberUtils.java35 int length = bytes.length;
36 if (length == 0) {
40 for (int i = length - 1; i >= 0; i--) {
/packages/services/Car/tests/obd2_test/src/com/android/car/obd2/test/
H A DUtils.java35 if (0 == arrays.length) return new int[] {};
36 if (1 == arrays.length) return arrays[0];
39 int totalSize = Arrays.stream(arrays).mapToInt((int[] array) -> array.length).sum();
41 int usedSize = arrays[0].length;
42 for (int i = 1; i < arrays.length; ++i) {
44 int length = array.length;
45 System.arraycopy(array, 0, newArray, usedSize, length);
46 usedSize += length;
/packages/apps/LegacyCamera/src/com/android/camera/
H A DExif.java30 int length = 0;
33 while (offset + 3 < jpeg.length && (jpeg[offset++] & 0xFF) == 0xFF) {
51 // Get the length and check if it is reasonable.
52 length = pack(jpeg, offset, 2, false);
53 if (length < 2 || offset + length > jpeg.length) {
54 Log.e(TAG, "Invalid length");
59 if (marker == 0xE1 && length >= 8 &&
63 length
121 pack(byte[] bytes, int offset, int length, boolean littleEndian) argument
[all...]
/packages/apps/Settings/src/com/android/settings/wifi/
H A DWifiUtils.java33 return ssid.length() > SSID_ASCII_MAX_LENGTH;
40 return ssid.length() < SSID_ASCII_MIN_LENGTH;
47 final int length = password.length();
48 return length >= PASSWORD_MIN_LENGTH && length <= PASSWORD_MAX_LENGTH;
/packages/apps/Gallery2/src/com/android/gallery3d/data/
H A DBytesBufferPool.java33 public int length; field in class:BytesBufferPool.BytesBuffer
42 length = 0;
44 int capacity = data.length;
46 int step = Math.min(READ_STEP, capacity - length);
47 int rc = fis.read(data, length, step);
49 length += rc;
51 if (length == capacity) {
52 byte[] newData = new byte[data.length * 2];
53 System.arraycopy(data, 0, newData, 0, data.length);
55 capacity = data.length;
[all...]
/packages/apps/UnifiedEmail/src/org/apache/commons/io/input/
H A DCharSequenceReader.java79 if (idx >= charSequence.length()) {
91 * @param length The maximum number of characters to read
95 public int read(char[] array, int offset, int length) { argument
96 if (idx >= charSequence.length()) {
102 if (length < 0 || (offset + length) > array.length) {
103 throw new IndexOutOfBoundsException("Array Size=" + array.length +
104 ", offset=" + offset + ", length=" + length);
[all...]
/packages/apps/TV/src/com/android/tv/tuner/util/
H A DByteArrayBuffer.java51 byte newbuffer[] = new byte[Math.max(this.buffer.length << 1, newlen)];
60 if ((off < 0) || (off > b.length) || (len < 0) ||
61 ((off + len) < 0) || ((off + len) > b.length)) {
68 if (newlen > this.buffer.length) {
77 if (newlen > this.buffer.length) {
88 if ((off < 0) || (off > b.length) || (len < 0) ||
89 ((off + len) < 0) || ((off + len) > b.length)) {
97 if (newlen > this.buffer.length) {
123 return this.buffer.length;
126 public int length() { method in class:ByteArrayBuffer
[all...]
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/jpegstream/
H A DStreamUtils.java32 int length = input.length - (input.length % 4);
33 if (output.length * 4 < length) {
37 for (int i = 0, j = 0; i < output.length; i++, j += 4) {
42 for (int i = 0, j = 0; i < output.length; i++, j += 4) {
47 return input.length % 4 != 0;
51 int[] output = new int[input.length / 4];
/packages/apps/Music/src/com/android/music/
H A DSortCursor.java57 int length = mCursors.length;
58 mSortColumns = new int[length];
59 for (int i = 0; i < length; i++) {
72 for (int j = 0; j < length; j++) {
81 for (int i = mRowNumCache.length - 1; i >= 0; i--) {
84 mCurRowNumCache = new int[ROWCACHESIZE][length];
90 int length = mCursors.length;
91 for (int i = 0; i < length;
[all...]
/packages/apps/Bluetooth/src/com/android/bluetooth/gatt/
H A DAdvertiseHelper.java56 int nameLength = nameBytes.length;
79 int dataLen = 2 + (manufacturerData == null ? 0 : manufacturerData.length);
85 System.arraycopy(manufacturerData, 0, concated, 2, manufacturerData.length);
88 ret.write(concated.length + 1);
90 ret.write(concated, 0, concated.length);
107 if (uuid.length == BluetoothUuid.UUID_BYTES_16_BIT) {
108 serviceUuids16.write(uuid, 0, uuid.length);
109 } else if (uuid.length == BluetoothUuid.UUID_BYTES_32_BIT) {
110 serviceUuids32.write(uuid, 0, uuid.length);
111 } else /*if (uuid.length
[all...]
/packages/apps/Test/connectivity/sl4n/rapidjson/test/unittest/
H A Djsoncheckertest.cpp21 static char* ReadFile(const char* filename, size_t& length) { argument
42 length = (size_t)ftell(fp);
44 char* json = (char*)malloc(length + 1);
45 size_t readLength = fread(json, 1, length, fp);
62 size_t length; local
63 char* json = ReadFile(filename, length);
83 size_t length; local
84 char* json = ReadFile(filename, length);
/packages/providers/ContactsProvider/src/com/android/providers/contacts/util/
H A DHex.java59 char[] cArray = new char[array.length * 2];
62 for (int i = 0; i < array.length; i++) {
64 if (zeroTerminated && index == 0 && i == array.length-1) {
83 int length = hexString.length();
85 if ((length & 0x01) != 0) {
90 byte[] out = new byte[length >> 1];
91 for (int i = 0, j = 0; j < length; i++) {
/packages/apps/Dialer/java/com/android/contacts/common/util/
H A DSearchUtil.java48 while (end < contents.length()) {
75 if (value.length() < substring.length()) {
81 // There will be a maximum of substring.length code points. But may be fewer.
82 // Since the array length is not an accurate size, we need to keep a separate variable.
83 final int[] substringCodePoints = new int[substring.length()];
84 int substringLength = 0; // may not equal substring.length()!!
85 for (int i = 0; i < substring.length(); ) {
92 for (int i = 0; i < value.length(); i = findNextTokenStart(value, i)) {
94 for (int j = i; j < value.length()
[all...]
/packages/apps/Camera2/src/com/android/camera/util/
H A DFileUtil.java58 int length = (int) file.length();
59 byte[] data = new byte[length];
63 while (offset < length) {
64 offset += stream.read(data, offset, length - offset);
/packages/apps/Dialer/java/com/android/voicemail/impl/mail/
H A DFixedLengthInputStream.java22 * A filtering InputStream that stops allowing reads after the given length has been read. This is
31 public FixedLengthInputStream(InputStream in, int length) { argument
33 this.mLength = length;
52 public int read(byte[] b, int offset, int length) throws IOException { argument
54 int d = mIn.read(b, offset, Math.min(mLength - mCount, length));
68 return read(b, 0, b.length);
77 return String.format("FixedLengthInputStream(in=%s, length=%d)", mIn.toString(), mLength);
/packages/apps/Email/provider_src/com/android/email/
H A DFixedLengthInputStream.java23 * A filtering InputStream that stops allowing reads after the given length has been read. This
32 public FixedLengthInputStream(InputStream in, int length) { argument
34 this.mLength = length;
53 public int read(byte[] b, int offset, int length) throws IOException { argument
55 int d = mIn.read(b, offset, Math.min(mLength - mCount, length));
69 return read(b, 0, b.length);
78 return String.format("FixedLengthInputStream(in=%s, length=%d)", mIn.toString(), mLength);
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/dictionarypack/
H A DAssetFileAddress.java25 * also the offset in the file and the length of this data. This class encapsulates these three.
32 public AssetFileAddress(final String filename, final long offset, final long length) { argument
35 mLength = length;
48 return new AssetFileAddress(filename, 0l, f.length());
56 * @param length the length.
60 final long offset, final long length) {
64 return new AssetFileAddress(filename, offset, length);
59 makeFromFileNameAndOffset(final String filename, final long offset, final long length) argument
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/keyboard/
H A DKeyboardLayoutTest.java40 assertEquals(0, keyboardLayout.getKeyCodes().length);
41 assertEquals(0, keyboardLayout.getKeyWidths().length);
42 assertEquals(0, keyboardLayout.getKeyHeights().length);
43 assertEquals(0, keyboardLayout.getKeyXCoordinates().length);
44 assertEquals(0, keyboardLayout.getKeyYCoordinates().length);
55 assertEquals(2, keyboardLayout.getKeyCodes().length);
56 assertEquals(2, keyboardLayout.getKeyWidths().length);
57 assertEquals(2, keyboardLayout.getKeyHeights().length);
58 assertEquals(2, keyboardLayout.getKeyXCoordinates().length);
59 assertEquals(2, keyboardLayout.getKeyYCoordinates().length);
[all...]
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/keyboard/layout/expected/
H A DAbstractKeyboardBuilder.java55 mRows = newArrayOfArray(rows.length);
56 for (int rowIndex = 0; rowIndex < rows.length; rowIndex++) {
58 mRows[rowIndex] = Arrays.copyOf(row, row.length);
75 return mRows.length;
86 if (rowIndex < 0 || rowIndex >= mRows.length) {
103 final E[][] newRows = (rowIndex < mRows.length) ? mRows
125 if (columnIndex >= elements.length + 1) {
128 final E[] newElements = Arrays.copyOf(elements, elements.length + 1);
131 elements.length - columnIndex);
138 final E[] newElements = (columnIndex < elements.length)
[all...]
/packages/inputmethods/LatinIME/tools/make-keyboard-text/src/com/android/inputmethod/keyboard/tools/
H A DLocaleUtils.java64 if (localeElements.length > INDEX_LANGUAGE) {
72 if (localeElements.length > INDEX_SCRIPT) {
83 if (localeElements.length > INDEX_REGION) {
118 final int length = text.length();
119 if (length < lower || length > upper) {
122 for (int index = 0; index < length; index++) {
131 final int length = text.length();
[all...]
/packages/apps/Gallery2/src/com/android/gallery3d/glrenderer/
H A DNinePatchChunk.java38 for (int i = 0, n = data.length; i < n; ++i) {
43 private static void checkDivCount(int length) { argument
44 if (length == 0 || (length & 0x01) != 0) {
45 throw new RuntimeException("invalid nine-patch: " + length);
61 checkDivCount(chunk.mDivX.length);
62 checkDivCount(chunk.mDivY.length);
/packages/apps/Contacts/src/com/android/contacts/list/
H A DContactsSectionIndexer.java47 if (sections.length != counts.length) {
49 "The sections and counts arrays must have the same length");
55 mPositions = new int[counts.length];
57 for (int i = 0; i < counts.length; i++) {
80 if (section < 0 || section >= mSections.length) {
108 if (mSections.length > 0 && mSections[0].isEmpty()) {
114 String[] tempSections = new String[mSections.length + 1];
115 int[] tempPositions = new int[mPositions.length + 1];
119 for (int i = 1; i <= mPositions.length;
[all...]
/packages/apps/Dialer/java/com/android/contacts/common/list/
H A DContactsSectionIndexer.java44 if (sections.length != counts.length) {
46 "The sections and counts arrays must have the same length");
52 mPositions = new int[counts.length];
54 for (int i = 0; i < counts.length; i++) {
72 if (section < 0 || section >= mSections.length) {
100 if (mSections.length > 0 && header.equals(mSections[0])) {
106 String[] tempSections = new String[mSections.length + 1];
107 int[] tempPositions = new int[mPositions.length + 1];
110 for (int i = 1; i <= mPositions.length;
[all...]
/packages/apps/UnifiedEmail/src/org/apache/james/mime4j/decoder/
H A DUnboundedFifoByteBuffer.java98 size = buffer.length - head + tail;
123 if (size() + 1 >= buffer.length) {
124 byte[] tmp = new byte[((buffer.length - 1) * 2) + 1];
133 if (i == buffer.length) {
145 if (tail >= buffer.length) {
179 if (head >= buffer.length) {
194 if (index >= buffer.length) {
209 index = buffer.length - 1;
254 if (i >= buffer.length) {

Completed in 663 milliseconds

1234567891011>>