Home
last modified time | relevance | path

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

12345

/packages/apps/UnifiedEmail/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()
97 long origin1EstimatedSize = bytes(3.5); in testCallbacks()
105 long origin2EstimatedSize = bytes(2.5); in testCallbacks()
128 long origin3EstimatedSize = bytes(5); in testCallbacks()
146 manager.onExceededDatabaseQuota("4", "4", 0, bytes(1), totalUsedQuota, mQuotaUpdater); in testCallbacks()
150 mAppCacheInfo.setAppCacheSizeBytes(bytes(2)); in testCallbacks()
152 manager.onReachedMaxAppCacheSize(bytes(2), totalUsedQuota, mQuotaUpdater); in testCallbacks()
160 manager.onReachedMaxAppCacheSize(bytes(1.5), totalUsedQuota, mQuotaUpdater); in testCallbacks()
[all …]
/packages/apps/Exchange/src/com/android/exchange/utility/
DCalendarUtilities.java195 static int getLong(byte[] bytes, int offset) { in getLong() argument
196 return (bytes[offset++] & 0xFF) | ((bytes[offset++] & 0xFF) << 8) | in getLong()
197 ((bytes[offset++] & 0xFF) << 16) | ((bytes[offset] & 0xFF) << 24); in getLong()
201 static void setLong(byte[] bytes, int offset, int value) { in setLong() argument
202 bytes[offset++] = (byte) (value & 0xFF); in setLong()
203 bytes[offset++] = (byte) ((value >> 8) & 0xFF); in setLong()
204 bytes[offset++] = (byte) ((value >> 16) & 0xFF); in setLong()
205 bytes[offset] = (byte) ((value >> 24) & 0xFF); in setLong()
209 static int getWord(byte[] bytes, int offset) { in getWord() argument
210 return (bytes[offset++] & 0xFF) | ((bytes[offset] & 0xFF) << 8); in getWord()
[all …]
/packages/apps/ContactsCommon/src/com/android/contacts/common/
DContactPhotoManager.java593 final byte[] bytes; field in ContactPhotoManagerImpl.BitmapHolder
601 public BitmapHolder(byte[] bytes, int originalSmallerExtent) { in BitmapHolder() argument
602 this.bytes = bytes; in BitmapHolder()
699 return value.bytes != null ? value.bytes.length : 0; in ContactPhotoManagerImpl()
719 private static String btk(int bytes) { in btk() argument
720 return ((bytes + 1023) / 1024) + "K"; in btk()
739 if (h.bytes != null) { in dumpStats()
740 rawBytes += h.bytes.length; in dumpStats()
901 if (holder.bytes == null) { in loadCachedPhoto()
908 if (holder.bytes.length < 8 * 1024) { in loadCachedPhoto()
[all …]
/packages/apps/CertInstaller/src/com/android/certinstaller/
DCredentialHelper.java92 byte[] bytes = bundle.getByteArray(key); in CredentialHelper()
93 Log.d(TAG, " " + key + ": " + ((bytes == null) ? -1 : bytes.length)); in CredentialHelper()
94 mBundle.put(key, bytes); in CredentialHelper()
123 byte[] bytes = savedStates.getByteArray(Credentials.USER_PRIVATE_KEY); in onRestoreStates()
124 if (bytes != null) { in onRestoreStates()
125 setPrivateKey(bytes); in onRestoreStates()
138 private void parseCert(byte[] bytes) { in parseCert() argument
139 if (bytes == null) { in parseCert()
147 new ByteArrayInputStream(bytes)); in parseCert()
199 void setPrivateKey(byte[] bytes) { in setPrivateKey() argument
[all …]
DUtil.java45 static <T> T fromBytes(byte[] bytes) { in fromBytes() argument
46 if (bytes == null) return null; in fromBytes()
49 new ObjectInputStream(new ByteArrayInputStream(bytes)); in fromBytes()
57 static String toMd5(byte[] bytes) { in toMd5() argument
61 algorithm.update(bytes); in toMd5()
70 private static String toHexString(byte[] bytes, String separator) { in toHexString() argument
72 for (byte b : bytes) { in toHexString()
/packages/apps/Camera/jni/
Dfeature_mos_jni.cpp406 jfloatArray bytes = env->NewFloatArray(11); in Java_com_android_camera_Mosaic_setSourceImageFromGPU() local
407 if(bytes != 0) in Java_com_android_camera_Mosaic_setSourceImageFromGPU()
409 env->SetFloatArrayRegion(bytes, 0, 11, (jfloat*) gTRS); in Java_com_android_camera_Mosaic_setSourceImageFromGPU()
411 return bytes; in Java_com_android_camera_Mosaic_setSourceImageFromGPU()
465 jfloatArray bytes = env->NewFloatArray(11); in Java_com_android_camera_Mosaic_setSourceImage() local
466 if(bytes != 0) in Java_com_android_camera_Mosaic_setSourceImage()
468 env->SetFloatArrayRegion(bytes, 0, 11, (jfloat*) gTRS); in Java_com_android_camera_Mosaic_setSourceImage()
470 return bytes; in Java_com_android_camera_Mosaic_setSourceImage()
603 jintArray bytes = env->NewIntArray(imageSize+2); in Java_com_android_camera_Mosaic_getFinalMosaic() local
604 if (bytes == 0) { in Java_com_android_camera_Mosaic_getFinalMosaic()
[all …]
/packages/apps/LegacyCamera/jni/
Dfeature_mos_jni.cpp406 jfloatArray bytes = env->NewFloatArray(11); in Java_com_android_camera_panorama_Mosaic_setSourceImageFromGPU() local
407 if(bytes != 0) in Java_com_android_camera_panorama_Mosaic_setSourceImageFromGPU()
409 env->SetFloatArrayRegion(bytes, 0, 11, (jfloat*) gTRS); in Java_com_android_camera_panorama_Mosaic_setSourceImageFromGPU()
411 return bytes; in Java_com_android_camera_panorama_Mosaic_setSourceImageFromGPU()
465 jfloatArray bytes = env->NewFloatArray(11); in Java_com_android_camera_panorama_Mosaic_setSourceImage() local
466 if(bytes != 0) in Java_com_android_camera_panorama_Mosaic_setSourceImage()
468 env->SetFloatArrayRegion(bytes, 0, 11, (jfloat*) gTRS); in Java_com_android_camera_panorama_Mosaic_setSourceImage()
470 return bytes; in Java_com_android_camera_panorama_Mosaic_setSourceImage()
603 jintArray bytes = env->NewIntArray(imageSize+2); in Java_com_android_camera_panorama_Mosaic_getFinalMosaic() local
604 if (bytes == 0) { in Java_com_android_camera_panorama_Mosaic_getFinalMosaic()
[all …]
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/
DFingerprint.java67 public Fingerprint(byte[] bytes) { in Fingerprint() argument
68 if ((bytes == null) || (bytes.length != FINGERPRINT_BYTE_LENGTH)) { in Fingerprint()
71 mMd5Digest = bytes; in Fingerprint()
87 byte[] bytes = new byte[8192]; in fromInputStream()
90 int n = in.read(bytes); in fromInputStream()
112 byte[] bytes = new byte[FINGERPRINT_BYTE_LENGTH]; in fromStreamId()
117 bytes[byteIdx++] = (byte) (value & 0xff); in fromStreamId()
119 return new Fingerprint(bytes); in fromStreamId()
180 private static void appendHexFingerprint(StringBuilder sb, byte[] bytes) { in appendHexFingerprint() argument
182 int value = bytes[idx]; in appendHexFingerprint()
/packages/apps/Nfc/src/com/android/nfc/snep/
DSnepMessage.java97 byte[] bytes = new byte[ndefLength]; in SnepMessage()
98 System.arraycopy(data, ndefOffset, bytes, 0, ndefLength); in SnepMessage()
99 mNdefMessage = new NdefMessage(bytes); in SnepMessage()
115 byte[] bytes; in toByteArray()
117 bytes = mNdefMessage.toByteArray(); in toByteArray()
119 bytes = new byte[0]; in toByteArray()
125 buffer = new ByteArrayOutputStream(bytes.length + HEADER_LENGTH + 4); in toByteArray()
127 buffer = new ByteArrayOutputStream(bytes.length + HEADER_LENGTH); in toByteArray()
134 output.writeInt(bytes.length + 4); in toByteArray()
137 output.writeInt(bytes.length); in toByteArray()
[all …]
/packages/apps/Gallery2/src/com/android/gallery3d/data/
DDecodeUtils.java78 public static Bitmap decode(JobContext jc, byte[] bytes, Options options) { in decode() argument
79 return decode(jc, bytes, 0, bytes.length, options); in decode()
82 public static Bitmap decode(JobContext jc, byte[] bytes, int offset, in decode() argument
88 BitmapFactory.decodeByteArray(bytes, offset, length, options)); in decode()
91 public static void decodeBounds(JobContext jc, byte[] bytes, int offset, in decodeBounds() argument
96 BitmapFactory.decodeByteArray(bytes, offset, length, options); in decodeBounds()
200 JobContext jc, byte[] bytes, int offset, int length, in createBitmapRegionDecoder() argument
202 if (offset < 0 || length <= 0 || offset + length > bytes.length) { in createBitmapRegionDecoder()
205 offset, length, bytes.length)); in createBitmapRegionDecoder()
210 bytes, offset, length, shareable); in createBitmapRegionDecoder()
/packages/providers/DownloadProvider/src/com/android/providers/downloads/
DStorageUtils.java90 public static void ensureAvailableSpace(Context context, FileDescriptor fd, long bytes) in ensureAvailableSpace() argument
94 if (availBytes >= bytes) { in ensureAvailableSpace()
117 pm.freeStorageAndNotify(sForceFullEviction ? Long.MAX_VALUE : bytes, observer); in ensureAvailableSpace()
129 freeCacheStorage(bytes); in ensureAvailableSpace()
134 if (availBytes < bytes) { in ensureAvailableSpace()
136 "Not enough free space; " + bytes + " requested, " + availBytes + " available"); in ensureAvailableSpace()
145 private static void freeCacheStorage(long bytes) { in freeCacheStorage() argument
162 if (bytes <= 0) break; in freeCacheStorage()
169 bytes -= len; in freeCacheStorage()
/packages/apps/UnifiedEmail/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/Exchange/tests/src/com/android/exchange/utility/
DCalendarUtilitiesTests.java119 byte[] bytes = new byte[] {0, 1, 2, 3, 4, 5, 6, 7}; in testGetSet()
122 assertEquals(0x0100, CalendarUtilities.getWord(bytes, 0)); in testGetSet()
123 assertEquals(0x03020100, CalendarUtilities.getLong(bytes, 0)); in testGetSet()
124 assertEquals(0x07060504, CalendarUtilities.getLong(bytes, 4)); in testGetSet()
127 CalendarUtilities.setWord(bytes, 0, 0xDEAD); in testGetSet()
128 CalendarUtilities.setLong(bytes, 2, 0xBEEFBEEF); in testGetSet()
129 CalendarUtilities.setWord(bytes, 6, 0xCEDE); in testGetSet()
132 assertEquals(0xDEAD, CalendarUtilities.getWord(bytes, 0)); in testGetSet()
133 assertEquals(0xBEEFBEEF, CalendarUtilities.getLong(bytes, 2)); in testGetSet()
134 assertEquals(0xCEDE, CalendarUtilities.getWord(bytes, 6)); in testGetSet()
[all …]
/packages/apps/ContactsCommon/src/com/android/contacts/common/util/
DBitmapUtil.java40 public static int getSmallerExtentFromBytes(byte[] bytes) { in getSmallerExtentFromBytes() argument
45 BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options); in getSmallerExtentFromBytes()
81 public static Bitmap decodeBitmapFromBytes(byte[] bytes, int sampleSize) { in decodeBitmapFromBytes() argument
89 return BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options); in decodeBitmapFromBytes()
/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/Nfc/nci/jni/
DNativeLlcpSocket.cpp120 ScopedByteArrayRO bytes(e, data); in nativeLlcpSocket_doSend() local
123 …UINT8* raw_ptr = const_cast<UINT8*>(reinterpret_cast<const UINT8*>(&bytes[0])); // TODO: API bug: … in nativeLlcpSocket_doSend()
124 bool stat = PeerToPeer::getInstance().send(jniHandle, raw_ptr, bytes.size()); in nativeLlcpSocket_doSend()
147 ScopedByteArrayRW bytes(e, origBuffer); in nativeLlcpSocket_doReceive() local
151 …rToPeer::getInstance().receive(jniHandle, reinterpret_cast<UINT8*>(&bytes[0]), bytes.size(), actua… in nativeLlcpSocket_doReceive()
DNativeNfcTag.cpp351 ScopedByteArrayRO bytes(e, buf); in nativeNfcTag_doWrite() local
352 …UINT8* p_data = const_cast<UINT8*>(reinterpret_cast<const UINT8*>(&bytes[0])); // TODO: const-ness… in nativeNfcTag_doWrite()
354 ALOGD ("%s: enter; len = %zu", __FUNCTION__, bytes.size()); in nativeNfcTag_doWrite()
380 status = NFA_RwWriteNDef (p_data, bytes.size()); in nativeNfcTag_doWrite()
382 else if (bytes.size() == 0) in nativeNfcTag_doWrite()
393 status = NFA_RwWriteNDef (p_data, bytes.size()); in nativeNfcTag_doWrite()
839 ScopedByteArrayRO bytes(e, data); in nativeNfcTag_doTransceive() local
840 …uint8_t* buf = const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(&bytes[0])); // TODO: API bug… in nativeNfcTag_doTransceive()
841 size_t bufLen = bytes.size(); in nativeNfcTag_doTransceive()
/packages/apps/Gallery2/jni_jpegstream/src/
Djpeg_reader.cpp117 int32_t JpegReader::read(int8_t* bytes, int32_t offset, int32_t count) { in read() argument
135 if (bytes != NULL) { in read()
137 memcpy((void*) (bytes + offset), (void*) mScanlineIter, in read()
145 if (bytes != NULL) { in read()
147 memcpy((void*) (bytes + offset), (void*) mScanlineIter, in read()
149 bytes += mScanlineBytesRemaining; in read()
Djpeg_writer.cpp116 int32_t JpegWriter::write(int8_t* bytes, int32_t length) { in write() argument
127 if (length < 0 || bytes == NULL) { in write()
136 memcpy((void*) mScanlineIter, (void*) bytes, in write()
143 memcpy((void*) mScanlineIter, (void*) bytes, in write()
145 bytes += mScanlineBytesRemaining; in write()
/packages/apps/Exchange/tests/src/com/android/exchange/adapter/
DParserTest.java61 final byte[] bytes = getValueBytes(); in parse()
64 final String hexStr = byteArrayToHexString(bytes); in parse()
74 private static String byteArrayToHexString(byte[] bytes) { in byteArrayToHexString() argument
75 char[] hexChars = new char[bytes.length * 2]; in byteArrayToHexString()
76 for ( int j = 0; j < bytes.length; j++ ) { in byteArrayToHexString()
77 int v = bytes[j] & 0xFF; in byteArrayToHexString()
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/
DStringUtils.java462 public static String byteArrayToHexString(final byte[] bytes) { in byteArrayToHexString() argument
463 if (bytes == null || bytes.length == 0) { in byteArrayToHexString()
467 for (byte b : bytes) { in byteArrayToHexString()
486 final byte[] bytes = new byte[N / 2]; in hexStringToByteArray()
488 bytes[i / 2] = (byte) ((Character.digit(hexString.charAt(i), 16) << 4) in hexStringToByteArray()
491 return bytes; in hexStringToByteArray()
/packages/apps/Terminal/jni/
Dcom_android_terminal_Terminal.cpp117 size_t write(const char *bytes, size_t len);
364 ssize_t bytes = ::read(mMasterFd, buffer, sizeof buffer); in run() local
366 ALOGD("read() returned %d bytes", bytes); in run()
373 if (bytes == 0) { in run()
377 if (bytes == -1) { in run()
384 vterm_push_bytes(mVt, buffer, bytes); in run()
392 size_t Terminal::write(const char *bytes, size_t len) { in write() argument
393 return ::write(mMasterFd, bytes, len); in write()
/packages/apps/Launcher3/protos/
Dbackup.proto36 required bytes payload = 1;
53 // Total bytes written during the last backup
56 optional int64 bytes = 3; field
90 optional bytes icon = 18;
100 required bytes data = 2;
/packages/apps/UnifiedEmail/src/com/google/android/mail/common/base/
DStringUtil.java757 byte[] bytes = new byte[(str.length() + 1) / 2]; in hexToBytes()
759 return bytes; in hexToBytes()
761 bytes[0] = 0; in hexToBytes()
769 bytes[nibbleIdx >> 1] = (byte) (hexValue(c) << 4); in hexToBytes()
771 bytes[nibbleIdx >> 1] += (byte) hexValue(c); in hexToBytes()
775 return bytes; in hexToBytes()
2691 @Deprecated public static String bytesToHexString(final byte[] bytes) { in bytesToHexString() argument
2692 return ByteArrays.toHexString(bytes); in bytesToHexString()
2699 public static String bytesToHexString(final byte[] bytes, in bytesToHexString() argument
2702 new StringBuilder(bytes.length * (delimiter == null ? 2 : 3)); in bytesToHexString()
[all …]

12345