/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/ |
H A D | FakeInputStream.java | 28 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 D | NumberUtils.java | 35 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 D | Utils.java | 35 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 D | Exif.java | 30 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/Gallery2/src/com/android/gallery3d/data/ |
H A D | BytesBufferPool.java | 33 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 D | CharSequenceReader.java | 79 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/services/NetworkRecommendation/src/com/android/networkrecommendation/util/ |
H A D | WifiConfigurationUtil.java | 30 for (int i = 0; i < wepKeys.length; i++) { 72 final int length = config.SSID.length(); 73 if (length > 2 && (config.SSID.charAt(0) == '"') && config.SSID.charAt(length - 1) == '"') { 74 return config.SSID.substring(1, length - 1); 82 final int length = config.SSID.length(); 83 if ((length > 1) && (config.SSID.charAt(0) == '"') 84 && (config.SSID.charAt(length [all...] |
/packages/apps/TV/src/com/android/tv/tuner/util/ |
H A D | ByteArrayBuffer.java | 51 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/Dialer/java/com/android/dialer/enrichedcall/ |
H A D | FuzzyPhoneNumberMatcher.java | 28 if (aNormalized.length() < 7 || bNormalized.length() < 7) { 31 String aMatchable = aNormalized.substring(aNormalized.length() - 7); 32 String bMatchable = bNormalized.substring(bNormalized.length() - 7);
|
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/jpegstream/ |
H A D | StreamUtils.java | 32 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 D | SortCursor.java | 57 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 D | AdvertiseHelper.java | 56 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 D | jsoncheckertest.cpp | 21 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 D | Hex.java | 59 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 D | SearchUtil.java | 48 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 D | FileUtil.java | 58 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 D | FixedLengthInputStream.java | 22 * 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 D | FixedLengthInputStream.java | 23 * 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 D | AssetFileAddress.java | 25 * 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 D | KeyboardLayoutTest.java | 40 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 D | AbstractKeyboardBuilder.java | 55 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 D | LocaleUtils.java | 64 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 D | NinePatchChunk.java | 38 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 D | ContactsSectionIndexer.java | 47 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 D | ContactsSectionIndexer.java | 44 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...] |