Home
last modified time | relevance | path

Searched refs:bytes (Results 1 – 25 of 33) sorted by relevance

12

/packages/apps/Email/src/org/apache/james/mime4j/codec/
DEncoderUtil.java336 byte[] bytes = encode(text, charset); in encodeEncodedWord()
339 encoding = determineEncoding(bytes, usage); in encodeEncodedWord()
343 return encodeB(prefix, text, usedCharacters, charset, bytes); in encodeEncodedWord()
346 return encodeQ(prefix, text, usage, usedCharacters, charset, bytes); in encodeEncodedWord()
358 public static String encodeB(byte[] bytes) { in encodeB() argument
362 final int end = bytes.length; in encodeB()
364 int data = (bytes[idx] & 0xff) << 16 | (bytes[idx + 1] & 0xff) << 8 in encodeB()
365 | bytes[idx + 2] & 0xff; in encodeB()
373 int data = (bytes[idx] & 0xff) << 16 | (bytes[idx + 1] & 0xff) << 8; in encodeB()
380 int data = (bytes[idx] & 0xff) << 16; in encodeB()
[all …]
/packages/apps/Browser/tests/src/com/android/browser/
DWebStorageSizeManagerUnitTests.java77 private long bytes(double megabytes) { in bytes() method in WebStorageSizeManagerUnitTests
88 mDiskInfo.setTotalSizeBytes(bytes(75)); in testCallbacks()
89 mDiskInfo.setFreeSpaceSizeBytes(bytes(24)); in testCallbacks()
96 long origin1EstimatedSize = bytes(3.5); in testCallbacks()
104 long origin2EstimatedSize = bytes(2.5); in testCallbacks()
127 long origin3EstimatedSize = bytes(5); in testCallbacks()
145 manager.onExceededDatabaseQuota("4", "4", 0, bytes(1), totalUsedQuota, mQuotaUpdater); in testCallbacks()
149 mAppCacheInfo.setAppCacheSizeBytes(bytes(2)); in testCallbacks()
151 manager.onReachedMaxAppCacheSize(bytes(2), totalUsedQuota, mQuotaUpdater); in testCallbacks()
159 manager.onReachedMaxAppCacheSize(bytes(1.5), totalUsedQuota, mQuotaUpdater); in testCallbacks()
[all …]
/packages/apps/CertInstaller/src/com/android/certinstaller/
DUtil.java47 static <T> T fromBytes(byte[] bytes) { in fromBytes() argument
48 if (bytes == null) return null; in fromBytes()
51 new ObjectInputStream(new ByteArrayInputStream(bytes)); in fromBytes()
59 static String toMd5(byte[] bytes) { in toMd5() argument
63 algorithm.update(bytes); in toMd5()
72 private static String toHexString(byte[] bytes, String separator) { in toHexString() argument
74 for (byte b : bytes) { in toHexString()
DCredentialHelper.java82 byte[] bytes = bundle.getByteArray(key); in CredentialHelper()
83 Log.d(TAG, " " + key + ": " + ((bytes == null) ? -1 : bytes.length)); in CredentialHelper()
84 mBundle.put(key, bytes); in CredentialHelper()
112 byte[] bytes = savedStates.getByteArray(Credentials.USER_PRIVATE_KEY); in onRestoreStates()
113 if (bytes != null) setPrivateKey(bytes); in onRestoreStates()
124 private void parseCert(byte[] bytes) { in parseCert() argument
125 if (bytes == null) return; in parseCert()
132 new ByteArrayInputStream(bytes)); in parseCert()
176 void setPrivateKey(byte[] bytes) { in setPrivateKey() argument
180 new PKCS8EncodedKeySpec(bytes)); in setPrivateKey()
DCertInstaller.java224 byte[] bytes = Util.toBytes((Serializable) map); in savePkeyMap()
225 if (!mKeyStore.put(PKEY_MAP_KEY, bytes)) { in savePkeyMap()
231 byte[] bytes = mKeyStore.get(PKEY_MAP_KEY); in getPkeyMap()
232 if (bytes != null) { in getPkeyMap()
234 (Map<String, byte[]>) Util.fromBytes(bytes); in getPkeyMap()
/packages/apps/Settings/src/com/android/settings/fuelgauge/
DUtils.java74 public static String formatBytes(Context context, double bytes) { in formatBytes() argument
76 if (bytes > 1000 * 1000) { in formatBytes()
77 return String.format("%.2f MB", ((int) (bytes / 1000)) / 1000f); in formatBytes()
78 } else if (bytes > 1024) { in formatBytes()
79 return String.format("%.2f KB", ((int) (bytes / 10)) / 100f); in formatBytes()
81 return String.format("%d bytes", (int) bytes); in formatBytes()
/packages/apps/Email/src/org/apache/commons/io/input/
DNullInputStream.java202 public int read(byte[] bytes) throws IOException { in read() argument
203 return read(bytes, 0, bytes.length); in read()
219 public int read(byte[] bytes, int offset, int length) throws IOException { in read() argument
232 processBytes(bytes, offset, returnLength); in read()
309 protected void processBytes(byte[] bytes, int offset, int length) { in processBytes() argument
/packages/apps/Nfc/src/com/android/nfc/ndefpush/
DNdefPushProtocol.java115 byte[] bytes = new byte[length]; in NdefPushProtocol()
119 lengthRead = input.read(bytes); in NdefPushProtocol()
131 mMessages[i] = new NdefMessage(bytes); in NdefPushProtocol()
157 byte[] bytes = mMessages[i].toByteArray(); in toByteArray()
158 output.writeInt(bytes.length); in toByteArray()
159 output.write(bytes); in toByteArray()
/packages/apps/Email/src/com/android/exchange/utility/
DCalendarUtilities.java155 static int getLong(byte[] bytes, int offset) { in getLong() argument
156 return (bytes[offset++] & 0xFF) | ((bytes[offset++] & 0xFF) << 8) | in getLong()
157 ((bytes[offset++] & 0xFF) << 16) | ((bytes[offset] & 0xFF) << 24); in getLong()
161 static void setLong(byte[] bytes, int offset, int value) { in setLong() argument
162 bytes[offset++] = (byte) (value & 0xFF); in setLong()
163 bytes[offset++] = (byte) ((value >> 8) & 0xFF); in setLong()
164 bytes[offset++] = (byte) ((value >> 16) & 0xFF); in setLong()
165 bytes[offset] = (byte) ((value >> 24) & 0xFF); in setLong()
169 static int getWord(byte[] bytes, int offset) { in getWord() argument
170 return (bytes[offset++] & 0xFF) | ((bytes[offset] & 0xFF) << 8); in getWord()
[all …]
/packages/apps/Email/src/com/android/email/
DUtility.java212 byte[] bytes = s.getBytes("UTF-8"); in fastUrlDecode()
215 for (int i = 0, count = bytes.length; i < count; i++) { in fastUrlDecode()
216 ch = bytes[i]; in fastUrlDecode()
218 int h = (bytes[i + 1] - '0'); in fastUrlDecode()
219 int l = (bytes[i + 2] - '0'); in fastUrlDecode()
226 bytes[length] = (byte) ((h << 4) | l); in fastUrlDecode()
230 bytes[length] = ' '; in fastUrlDecode()
233 bytes[length] = bytes[i]; in fastUrlDecode()
237 return new String(bytes, 0, length, "UTF-8"); in fastUrlDecode()
500 final byte[] bytes = new byte[buffer.limit()]; in encode()
[all …]
/packages/apps/Email/tests/src/com/android/exchange/utility/
DSimpleIcsWriterTests.java80 final byte[] bytes = ics.getBytes(); in checkWriteLine()
84 for (byte b : bytes) { in checkWriteLine()
99 final String actual = Utility.fromUtf8(bytes); in checkWriteLine()
DCalendarUtilitiesTests.java104 byte[] bytes = new byte[] {0, 1, 2, 3, 4, 5, 6, 7}; in testGetSet()
107 assertEquals(0x0100, CalendarUtilities.getWord(bytes, 0)); in testGetSet()
108 assertEquals(0x03020100, CalendarUtilities.getLong(bytes, 0)); in testGetSet()
109 assertEquals(0x07060504, CalendarUtilities.getLong(bytes, 4)); in testGetSet()
112 CalendarUtilities.setWord(bytes, 0, 0xDEAD); in testGetSet()
113 CalendarUtilities.setLong(bytes, 2, 0xBEEFBEEF); in testGetSet()
114 CalendarUtilities.setWord(bytes, 6, 0xCEDE); in testGetSet()
117 assertEquals(0xDEAD, CalendarUtilities.getWord(bytes, 0)); in testGetSet()
118 assertEquals(0xBEEFBEEF, CalendarUtilities.getLong(bytes, 2)); in testGetSet()
119 assertEquals(0xCEDE, CalendarUtilities.getWord(bytes, 6)); in testGetSet()
[all …]
/packages/apps/Contacts/src/com/android/contacts/
DContactPhotoLoader.java290 private void cacheBitmap(long id, byte[] bytes) { in cacheBitmap() argument
297 if (bytes != null) { in cacheBitmap()
299 Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length, null); in cacheBitmap()
401 byte[] bytes = cursor.getBlob(1); in loadPhotosFromDatabase()
402 cacheBitmap(id, bytes); in loadPhotosFromDatabase()
/packages/apps/Email/src/com/android/email/mail/internet/
DTextBody.java38 byte[] bytes = mBody.getBytes("UTF-8"); in writeTo()
39 out.write(Base64.encode(bytes, Base64.CRLF)); in writeTo()
/packages/apps/Email/src/org/apache/james/mime4j/decoder/
DDecoderUtil.java52 byte[] bytes = s.getBytes("US-ASCII"); in decodeBaseQuotedPrintable()
55 new ByteArrayInputStream(bytes)); in decodeBaseQuotedPrintable()
81 byte[] bytes = s.getBytes("US-ASCII"); in decodeBase64()
84 new ByteArrayInputStream(bytes)); in decodeBase64()
/packages/apps/Mms/src/com/android/mms/util/
DAddressUtils.java56 byte[] bytes = PduPersister.getBytes(from); in getFrom()
58 return new EncodedStringValue(charset, bytes) in getFrom()
/packages/apps/Tag/src/com/android/vcard/
DVCardUtils.java62 public static final byte[] decodeQuotedPrintable(byte[] bytes) in decodeQuotedPrintable() argument
64 if (bytes == null) { in decodeQuotedPrintable()
68 for (int i = 0; i < bytes.length; i++) { in decodeQuotedPrintable()
69 int b = bytes[i]; in decodeQuotedPrintable()
72 int u = Character.digit((char) bytes[++i], 16); in decodeQuotedPrintable()
73 int l = Character.digit((char) bytes[++i], 16); in decodeQuotedPrintable()
822 final byte[] bytes = new byte[byteBuffer.remaining()]; in convertStringCharset()
823 byteBuffer.get(bytes); in convertStringCharset()
825 return new String(bytes, targetCharset); in convertStringCharset()
/packages/apps/Email/tests/src/com/android/email/
DUtilityUnitTests.java153 byte[] bytes = Utility.toUtf8(aChar); in checkIsFirstUtf8Byte()
154 assertTrue("0", Utility.isFirstUtf8Byte(bytes[0])); in checkIsFirstUtf8Byte()
155 for (int i = 1; i < bytes.length; i++) { in checkIsFirstUtf8Byte()
156 assertFalse(Integer.toString(i), Utility.isFirstUtf8Byte(bytes[i])); in checkIsFirstUtf8Byte()
/packages/apps/Email/src/org/apache/commons/io/
DEndianUtils.java413 byte[] bytes = new byte[8]; in readSwappedLong()
415 bytes[i] = (byte) read( input ); in readSwappedLong()
417 return readSwappedLong( bytes, 0 ); in readSwappedLong()
DFileSystemUtils.java364 long bytes = Long.parseLong(freeSpace); in parseBytes() local
365 if (bytes < 0) { in parseBytes()
370 return bytes; in parseBytes()
DIOUtils.java594 byte[] bytes = input.getBytes(); in toInputStream()
595 return new ByteArrayInputStream(bytes); in toInputStream()
612 byte[] bytes = encoding != null ? input.getBytes(encoding) : input.getBytes(); in toInputStream()
613 return new ByteArrayInputStream(bytes); in toInputStream()
/packages/apps/Gallery3D/src/com/cooliris/picasa/
DGDataClient.java197 ByteArrayOutputStream bytes = new ByteArrayOutputStream(); in inputStreamToString() local
201 bytes.write(buffer, 0, bytesRead); in inputStreamToString()
203 return new String(bytes.toString()); in inputStreamToString()
/packages/apps/Email/tests/src/com/android/exchange/adapter/
DEmailSyncAdapterTests.java190 byte[] bytes = s.toByteArray(); in testDeleteParser()
191 mSyncParser.resetInput(new ByteArrayInputStream(bytes)); in testDeleteParser()
222 byte[] bytes = s.toByteArray(); in testChangeParser()
223 mSyncParser.resetInput(new ByteArrayInputStream(bytes)); in testChangeParser()
/packages/apps/Mms/src/com/android/mms/model/
DMediaModelFactory.java123 byte[] bytes = part.getContentType(); in getGenericMediaModel()
124 if (bytes == null) { in getGenericMediaModel()
129 String contentType = new String(bytes); in getGenericMediaModel()
/packages/apps/Tag/canon/src/com/android/apps/tagcanon/
DTagCanon.java110 public TagDescription(String title, byte[] bytes) { in TagDescription() argument
113 msgs = new NdefMessage[] { new NdefMessage(bytes) }; in TagDescription()

12