/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/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/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 | 59 int length = mCursors.length; 60 mSortColumns = new int[length]; 61 for (int i = 0 ; i < length ; i++) { 74 for (int j = 0 ; j < length; j++) { 84 for (int i = mRowNumCache.length - 1; i >= 0; i--) { 87 mCurRowNumCache = new int[ROWCACHESIZE][length]; 94 int length = mCursors.length; 95 for (int i = 0 ; i < length ; [all...] |
/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/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/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);
|
H A D | PeekableInputStream.java | 55 public int read(byte[] b, int offset, int length) throws IOException { argument 57 return mIn.read(b, offset, length); 61 int r = mIn.read(b, offset + 1, length - 1); 72 return read(b, 0, b.length);
|
/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/services/Telephony/src/com/android/phone/common/mail/ |
H A D | FixedLengthInputStream.java | 22 * A filtering InputStream that stops allowing reads after the given length has been read. This 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/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/ContactsCommon/src/com/android/contacts/common/list/ |
H A D | ContactsSectionIndexer.java | 46 if (sections.length != counts.length) { 48 "The sections and counts arrays must have the same length"); 54 mPositions = new int[counts.length]; 56 for (int i = 0; i < counts.length; i++) { 74 if (section < 0 || section >= mSections.length) { 102 if (mSections.length > 0 && header.equals(mSections[0])) { 108 String[] tempSections = new String[mSections.length + 1]; 109 int[] tempPositions = new int[mPositions.length + 1]; 112 for (int i = 1; i <= mPositions.length; [all...] |
/packages/apps/UnifiedEmail/src/org/apache/james/mime4j/decoder/ |
H A D | UnboundedFifoByteBuffer.java | 98 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) {
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/ |
H A D | NgramContextUtils.java | 63 if (lines.length == 0) { 66 final String[] w = SPACE_REGEX.split(lines[lines.length - 1]); 70 for (int i = 0; i < prevWordsInfo.length; i++) { 71 final int focusedWordIndex = w.length - n - i; 73 if ((focusedWordIndex + 1) >= 0 && (focusedWordIndex + 1) < w.length) { 92 final int length = focusedWord.length(); 93 if (length <= 0) { 98 final char lastChar = focusedWord.charAt(length - 1);
|
/packages/services/Telephony/src/org/apache/james/mime4j/decoder/ |
H A D | UnboundedFifoByteBuffer.java | 98 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) {
|
/packages/apps/Email/src/com/beetstra/jutf7/ |
H A D | Base64Util.java | 69 if (alphabet.length() != ALPHABET_LENGTH)
70 throw new IllegalArgumentException("alphabet has incorrect length (should be 64, not "
71 + alphabet.length() + ")");
74 for (int i = 0; i < this.alphabet.length; i++) {
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/keyboard/internal/ |
H A D | MatrixUtils.java | 103 final int size = squareMatrix.length; 104 if (squareMatrix[0].length != size || inverseMatrix.length != size 105 || inverseMatrix[0].length != size) { 107 "--- invalid length. column should be 2 times larger than row."); 125 if (m0[0].length != m1.length) { 127 "--- invalid length for multiply " + m0[0].length + ", " + m1.length); [all...] |
/packages/apps/Bluetooth/src/com/android/bluetooth/opp/ |
H A D | BluetoothOppSendFileInfo.java | 80 public BluetoothOppSendFileInfo(String fileName, String type, long length, argument 84 mLength = length; 91 public BluetoothOppSendFileInfo(String data, String type, long length, int status) { argument 96 mLength = length; 106 long length = 0; 125 length = metadataCursor.getLong(1); 126 if (D) Log.d(TAG, "fileName = " + fileName + " length = " + length); 140 length = f.length(); [all...] |
/packages/apps/Gallery2/jni_jpegstream/src/ |
H A D | outputstream_wrapper.cpp | 22 int32_t OutputStreamWrapper::write(int32_t length, int32_t offset) { argument 23 if (offset < 0 || length < 0 || (offset + length) > getBufferSize()) { 36 mEnv->CallVoidMethod(mStream, sWriteID, mByteArray, offset, length);
|