/packages/apps/Contacts/src/com/android/contacts/util/ |
H A D | BitmapUtil.java | 32 public static int getSmallerExtentFromBytes(byte[] bytes) { argument 37 BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options); 69 public static Bitmap decodeBitmapFromBytes(byte[] bytes, int sampleSize) { argument 77 return BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options);
|
/packages/apps/Settings/src/com/android/settings/fuelgauge/ |
H A D | Utils.java | 24 * Contains utility functions for formatting elapsed time and consumed bytes 69 * Formats data size in KB, MB, from the given bytes. 71 * @param bytes data size in bytes 72 * @return the formatted size such as 4.52 MB or 245 KB or 332 bytes 74 public static String formatBytes(Context context, double bytes) { argument 76 if (bytes > 1000 * 1000) { 77 return String.format("%.2f MB", ((int) (bytes / 1000)) / 1000f); 78 } else if (bytes > 1024) { 79 return String.format("%.2f KB", ((int) (bytes / 1 [all...] |
/packages/apps/Browser/tests/src/com/android/browser/ |
H A D | WebStorageSizeManagerUnitTests.java | 77 private long bytes(double megabytes) { method in class:WebStorageSizeManagerUnitTests 88 mDiskInfo.setTotalSizeBytes(bytes(75)); 89 mDiskInfo.setFreeSpaceSizeBytes(bytes(24)); 97 long origin1EstimatedSize = bytes(3.5); 105 long origin2EstimatedSize = bytes(2.5); 128 long origin3EstimatedSize = bytes(5); 146 manager.onExceededDatabaseQuota("4", "4", 0, bytes(1), totalUsedQuota, mQuotaUpdater); 150 mAppCacheInfo.setAppCacheSizeBytes(bytes(2)); 152 manager.onReachedMaxAppCacheSize(bytes(2), totalUsedQuota, mQuotaUpdater); 160 manager.onReachedMaxAppCacheSize(bytes(1. [all...] |
/packages/apps/CertInstaller/src/com/android/certinstaller/ |
H A D | Util.java | 45 static <T> T fromBytes(byte[] bytes) { argument 46 if (bytes == null) return null; 49 new ObjectInputStream(new ByteArrayInputStream(bytes)); 57 static String toMd5(byte[] bytes) { argument 61 algorithm.update(bytes); 70 private static String toHexString(byte[] bytes, String separator) { argument 72 for (byte b : bytes) {
|
H A D | CredentialHelper.java | 88 byte[] bytes = bundle.getByteArray(key); 89 Log.d(TAG, " " + key + ": " + ((bytes == null) ? -1 : bytes.length)); 90 mBundle.put(key, bytes); 119 byte[] bytes = savedStates.getByteArray(Credentials.USER_PRIVATE_KEY); 120 if (bytes != null) { 121 setPrivateKey(bytes); 134 private void parseCert(byte[] bytes) { argument 135 if (bytes == null) { 143 new ByteArrayInputStream(bytes)); 195 setPrivateKey(byte[] bytes) argument [all...] |
/packages/apps/Email/src/org/apache/james/mime4j/codec/ |
H A D | EncoderUtil.java | 336 byte[] bytes = encode(text, charset); 339 encoding = determineEncoding(bytes, usage); 343 return encodeB(prefix, text, usedCharacters, charset, bytes); 346 return encodeQ(prefix, text, usage, usedCharacters, charset, bytes); 354 * @param bytes 358 public static String encodeB(byte[] bytes) { argument 362 final int end = bytes.length; 364 int data = (bytes[idx] & 0xff) << 16 | (bytes[idx + 1] & 0xff) << 8 365 | bytes[id 401 encodeQ(byte[] bytes, Usage usage) argument 512 encodeB(String prefix, String text, int usedCharacters, Charset charset, byte[] bytes) argument 536 bEncodedLength(byte[] bytes) argument 540 encodeQ(String prefix, String text, Usage usage, int usedCharacters, Charset charset, byte[] bytes) argument 564 qEncodedLength(byte[] bytes, Usage usage) argument 608 determineEncoding(byte[] bytes, Usage usage) argument [all...] |
/packages/apps/Email/src/org/apache/commons/io/input/ |
H A D | NullInputStream.java | 34 * large numbers of bytes - significantly speeding up
52 * protected void processBytes(byte[] bytes, int offset, int length) {
54 * bytes[i] = ... // set array value here
119 * Return the number of bytes that can be read.
121 * @return The number of bytes that can be read.
149 * @param readlimit The number of bytes before this marked position
192 * Read some bytes into the specified array.
194 * @param bytes The byte array to read into
195 * @return The number of bytes read or <code>-1</code>
202 public int read(byte[] bytes) throw argument 219 read(byte[] bytes, int offset, int length) argument 309 processBytes(byte[] bytes, int offset, int length) argument [all...] |
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/ |
H A D | Fingerprint.java | 47 // 16 bytes for 128-bit fingerprint 65 // md5 digest bytes. 71 public Fingerprint(byte[] bytes) { argument 72 if ((bytes == null) || (bytes.length != FINGERPRINT_BYTE_LENGTH)) { 75 mMd5Digest = bytes; 91 byte[] bytes = new byte[8192]; 94 int n = in.read(bytes); 115 // decode the hex bytes of the fingerprint portion 116 byte[] bytes 184 appendHexFingerprint(StringBuilder sb, byte[] bytes) argument [all...] |
/packages/apps/Nfc/src/com/android/nfc/snep/ |
H A D | SnepMessage.java | 97 byte[] bytes = new byte[ndefLength]; 98 System.arraycopy(data, ndefOffset, bytes, 0, ndefLength); 99 mNdefMessage = new NdefMessage(bytes); 115 byte[] bytes; 117 bytes = mNdefMessage.toByteArray(); 119 bytes = new byte[0]; 125 buffer = new ByteArrayOutputStream(bytes.length + HEADER_LENGTH + 4); 127 buffer = new ByteArrayOutputStream(bytes.length + HEADER_LENGTH); 134 output.writeInt(bytes.length + 4); 137 output.writeInt(bytes [all...] |
/packages/apps/Email/emailcommon/src/com/android/emailcommon/internet/ |
H A D | TextBody.java | 38 byte[] bytes = mBody.getBytes("UTF-8"); 39 out.write(Base64.encode(bytes, Base64.CRLF));
|
/packages/apps/Gallery2/src/com/android/gallery3d/data/ |
H A D | DecodeUtils.java | 67 public static Bitmap decode(JobContext jc, byte[] bytes, Options options) { argument 68 return decode(jc, bytes, 0, bytes.length, options); 71 public static Bitmap decode(JobContext jc, byte[] bytes, int offset, argument 76 BitmapFactory.decodeByteArray(bytes, offset, length, options)); 79 public static void decodeBounds(JobContext jc, byte[] bytes, int offset, argument 84 BitmapFactory.decodeByteArray(bytes, offset, length, options); 185 JobContext jc, byte[] bytes, int offset, int length, 187 if (offset < 0 || length <= 0 || offset + length > bytes.length) { 189 "offset = %s, length = %s, bytes 184 createBitmapRegionDecoder( JobContext jc, byte[] bytes, int offset, int length, boolean shareable) argument [all...] |
H A D | SizeClustering.java | 112 long bytes = SIZE_LEVELS[index]; 113 if (bytes >= GIGA_BYTES) { 114 return (bytes / GIGA_BYTES) + "GB"; 116 return (bytes / MEGA_BYTES) + "MB";
|
H A D | MtpImage.java | 96 byte[] bytes = mMtpContext.getMtpClient().getObject( 99 jc, bytes, 0, bytes.length, false);
|
/packages/apps/Nfc/src/com/android/nfc/ndefpush/ |
H A D | NdefPushProtocol.java | 115 byte[] bytes = new byte[length]; 119 lengthRead = input.read(bytes); 121 Log.w(TAG, "Unable to read bytes for message " + i); 125 Log.w(TAG, "Read " + lengthRead + " bytes but expected " + 131 mMessages[i] = new NdefMessage(bytes); 157 byte[] bytes = mMessages[i].toByteArray(); 158 output.writeInt(bytes.length); 159 output.write(bytes);
|
/packages/apps/Exchange/exchange2/tests/src/com/android/exchange/utility/ |
H A D | SimpleIcsWriterTests.java | 70 * @return a String of {@code length} bytes in UTF-8. 83 final byte[] bytes = ics.getBytes(); 85 // Verify that no lines are longer than 75 bytes. 87 for (byte b : bytes) { 102 final String actual = Utility.fromUtf8(bytes);
|
/packages/apps/Exchange/tests/src/com/android/exchange/utility/ |
H A D | SimpleIcsWriterTests.java | 70 * @return a String of {@code length} bytes in UTF-8. 83 final byte[] bytes = ics.getBytes(); 85 // Verify that no lines are longer than 75 bytes. 87 for (byte b : bytes) { 102 final String actual = Utility.fromUtf8(bytes);
|
/packages/apps/Camera/jni/ |
H A D | feature_mos_jni.cpp | 406 jfloatArray bytes = env->NewFloatArray(11); local 407 if(bytes != 0) 409 env->SetFloatArrayRegion(bytes, 0, 11, (jfloat*) gTRS); 411 return bytes; 465 jfloatArray bytes = env->NewFloatArray(11); local 466 if(bytes != 0) 468 env->SetFloatArrayRegion(bytes, 0, 11, (jfloat*) gTRS); 470 return bytes; 603 jintArray bytes = env->NewIntArray(imageSize+2); local 604 if (bytes 654 jbyteArray bytes = env->NewByteArray(imageSize+8); local [all...] |
/packages/apps/LegacyCamera/jni/ |
H A D | feature_mos_jni.cpp | 406 jfloatArray bytes = env->NewFloatArray(11); local 407 if(bytes != 0) 409 env->SetFloatArrayRegion(bytes, 0, 11, (jfloat*) gTRS); 411 return bytes; 465 jfloatArray bytes = env->NewFloatArray(11); local 466 if(bytes != 0) 468 env->SetFloatArrayRegion(bytes, 0, 11, (jfloat*) gTRS); 470 return bytes; 603 jintArray bytes = env->NewIntArray(imageSize+2); local 604 if (bytes 654 jbyteArray bytes = env->NewByteArray(imageSize+8); local [all...] |
/packages/apps/Contacts/src/com/android/contacts/ |
H A D | ContactPhotoManager.java | 235 * @param photoBytes The bytes that were parsed to create the bitmap. 286 final byte[] bytes; field in class:ContactPhotoManagerImpl.BitmapHolder 294 public BitmapHolder(byte[] bytes, int originalSmallerExtent) { argument 295 this.bytes = bytes; 304 * An LRU cache for bitmap holders. The cache contains bytes for photos just 323 * them from bytes (the bytes are stored in {@link #mBitmapHolderCache}. 388 return value.bytes != null ? value.bytes 405 btk(int bytes) argument 755 cacheBitmap(Object key, byte[] bytes, boolean preloading, int requestedExtent) argument [all...] |
/packages/apps/Camera/src/com/android/camera/ |
H A D | Exif.java | 122 private static int pack(byte[] bytes, int offset, int length, argument 132 value = (value << 8) | (bytes[offset] & 0xFF);
|
/packages/apps/Exchange/exchange2/tests/src/com/android/exchange/adapter/ |
H A D | SerializerTests.java | 55 // Get the bytes for the stream 56 byte[] bytes = s.toByteArray(); 57 // These are the expected bytes (self-explanatory) 92 MoreAsserts.assertEquals("Serializer mismatch", bytes, expectedBytes);
|
/packages/apps/Exchange/tests/src/com/android/exchange/adapter/ |
H A D | SerializerTests.java | 55 // Get the bytes for the stream 56 byte[] bytes = s.toByteArray(); 57 // These are the expected bytes (self-explanatory) 92 MoreAsserts.assertEquals("Serializer mismatch", bytes, expectedBytes);
|
/packages/apps/LegacyCamera/src/com/android/camera/ |
H A D | Exif.java | 121 private static int pack(byte[] bytes, int offset, int length, argument 131 value = (value << 8) | (bytes[offset] & 0xFF);
|
/packages/apps/Mms/src/com/android/mms/util/ |
H A D | AddressUtils.java | 60 byte[] bytes = PduPersister.getBytes(from); 62 return new EncodedStringValue(charset, bytes)
|
/packages/apps/Exchange/exchange2/src/com/android/exchange/utility/ |
H A D | CalendarUtilities.java | 195 static int getLong(byte[] bytes, int offset) { argument 196 return (bytes[offset++] & 0xFF) | ((bytes[offset++] & 0xFF) << 8) | 197 ((bytes[offset++] & 0xFF) << 16) | ((bytes[offset] & 0xFF) << 24); 201 static void setLong(byte[] bytes, int offset, int value) { argument 202 bytes[offset++] = (byte) (value & 0xFF); 203 bytes[offset++] = (byte) ((value >> 8) & 0xFF); 204 bytes[offset++] = (byte) ((value >> 16) & 0xFF); 205 bytes[offse 209 getWord(byte[] bytes, int offset) argument 214 setWord(byte[] bytes, int offset, int value) argument 236 putRuleIntoTimeZoneInformation(byte[] bytes, int offset, RRule rrule, int hour, int minute) argument 250 putTransitionMillisIntoSystemTime(byte[] bytes, int offset, long millis) argument 271 getTimeZoneDateFromSystemTime(byte[] bytes, int offset) argument [all...] |