Home
last modified time | relevance | path

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

12345678910>>...21

/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/csharp/src/Google.Protobuf/
DByteString.cs48 private readonly byte[] bytes; field in Google.Protobuf.ByteString
59 internal static ByteString FromBytes(byte[] bytes) in FromBytes() argument
61 return new ByteString(bytes); in FromBytes()
68 internal static byte[] GetBuffer(ByteString bytes) in GetBuffer() argument
70 return bytes.bytes; in GetBuffer()
77 internal static ByteString AttachBytes(byte[] bytes) in AttachBytes() argument
79 return new ByteString(bytes); in AttachBytes()
86 private ByteString(byte[] bytes) in ByteString() argument
88 this.bytes = bytes; in ByteString()
104 get { return bytes.Length; }
[all …]
DByteArray.cs69 internal static void Reverse(byte[] bytes) in Reverse() argument
71 for (int first = 0, last = bytes.Length - 1; first < last; first++, last--) in Reverse()
73 byte temp = bytes[first]; in Reverse()
74 bytes[first] = bytes[last]; in Reverse()
75 bytes[last] = temp; in Reverse()
/frameworks/opt/net/voip/src/jni/rtp/
DAmrCodec.cpp102 unsigned char *bytes = (unsigned char *)payload; in encode() local
106 samples, bytes + 1, &type, AMR_TX_WMF); in encode()
113 bytes[0] = 0xF0; in encode()
114 bytes[1] = (mMode << 3) | 0x04; in encode()
118 bytes[0] = 0xFF; in encode()
119 bytes[1] = 0xC0 | (mMode << 1) | 1; in encode()
122 bytes[length + 1] = 0; in encode()
124 bytes[i] = (bytes[i] << 6) | (bytes[i + 1] >> 2); in encode()
133 unsigned char *bytes = (unsigned char *)payload; in decode() local
138 int request = bytes[0] >> 4; in decode()
[all …]
/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/
DByteStringTest.java91 byte[] bytes = getTestBytes(); in testSubstring_BeginIndex()
92 ByteString substring = ByteString.copyFrom(bytes).substring(500); in testSubstring_BeginIndex()
94 isArrayRange(substring.toByteArray(), bytes, 500, bytes.length - 500)); in testSubstring_BeginIndex()
98 byte[] bytes = getTestBytes(); in testCopyFrom_BytesOffsetSize()
99 ByteString byteString = ByteString.copyFrom(bytes, 500, 200); in testCopyFrom_BytesOffsetSize()
101 isArrayRange(byteString.toByteArray(), bytes, 500, 200)); in testCopyFrom_BytesOffsetSize()
105 byte[] bytes = getTestBytes(); in testCopyFrom_Bytes()
106 ByteString byteString = ByteString.copyFrom(bytes); in testCopyFrom_Bytes()
108 isArray(byteString.toByteArray(), bytes)); in testCopyFrom_Bytes()
112 byte[] bytes = getTestBytes(); in testCopyFrom_ByteBufferSize()
[all …]
DCodedOutputStreamTest.java56 private byte[] bytes(int... bytesAsInts) { in bytes() method in CodedOutputStreamTest
57 byte[] bytes = new byte[bytesAsInts.length]; in bytes()
59 bytes[i] = (byte) bytesAsInts[i]; in bytes()
61 return bytes; in bytes()
65 private List<Byte> toList(byte[] bytes) { in toList() argument
67 for (byte b : bytes) { in toList()
132 assertWriteVarint(bytes(0x00), 0); in testWriteVarint()
133 assertWriteVarint(bytes(0x01), 1); in testWriteVarint()
134 assertWriteVarint(bytes(0x7f), 127); in testWriteVarint()
136 assertWriteVarint(bytes(0xa2, 0x74), (0x22 << 0) | (0x74 << 7)); in testWriteVarint()
[all …]
/frameworks/rs/rsov/compiler/spirit/
Dword_stream_test.cpp30 const std::vector<uint8_t> bytes((uint8_t *)words.data(), in TEST() local
34 EXPECT_EQ(bytesExpected, bytes); in TEST()
41 const std::vector<uint8_t> bytes((uint8_t *)words.data(), in TEST() local
46 EXPECT_EQ(bytesExpected, bytes); in TEST()
50 uint8_t bytes[] = {0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x00}; in TEST() local
51 std::vector<uint32_t> words((uint32_t *)bytes, in TEST()
52 (uint32_t *)(bytes + sizeof(bytes))); in TEST()
60 uint8_t bytes[] = {0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, in TEST() local
62 std::vector<uint32_t> words((uint32_t *)bytes, in TEST()
63 (uint32_t *)(bytes + sizeof(bytes))); in TEST()
Dinstructions_test.cpp34 uint8_t bytes[] = {0x0a, 0x00, 0x03, 0x00, 0x41, 0x42, in TEST() local
36 std::vector<uint32_t> words((uint32_t *)bytes, in TEST()
37 (uint32_t *)(bytes + sizeof(bytes))); in TEST()
44 uint8_t bytes[] = {0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, in TEST() local
47 std::vector<uint32_t> words((uint32_t *)bytes, in TEST()
48 (uint32_t *)(bytes + sizeof(bytes))); in TEST()
/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/java/core/src/test/java/com/google/protobuf/
DByteStringTest.java92 byte[] bytes = getTestBytes(); in testSubstring_BeginIndex()
93 ByteString substring = ByteString.copyFrom(bytes).substring(500); in testSubstring_BeginIndex()
95 isArrayRange(substring.toByteArray(), bytes, 500, bytes.length - 500)); in testSubstring_BeginIndex()
99 byte[] bytes = getTestBytes(); in testCopyFrom_BytesOffsetSize()
100 ByteString byteString = ByteString.copyFrom(bytes, 500, 200); in testCopyFrom_BytesOffsetSize()
102 isArrayRange(byteString.toByteArray(), bytes, 500, 200)); in testCopyFrom_BytesOffsetSize()
106 byte[] bytes = getTestBytes(); in testCopyFrom_Bytes()
107 ByteString byteString = ByteString.copyFrom(bytes); in testCopyFrom_Bytes()
109 isArray(byteString.toByteArray(), bytes)); in testCopyFrom_Bytes()
113 byte[] bytes = getTestBytes(); in testCopyFrom_ByteBufferSize()
[all …]
DIsValidUtf8Test.java135 private byte[] toByteArray(int... bytes) { in toByteArray() argument
136 byte[] realBytes = new byte[bytes.length]; in toByteArray()
137 for (int i = 0; i < bytes.length; i++) { in toByteArray()
138 realBytes[i] = (byte) bytes[i]; in toByteArray()
143 private void assertValidUtf8(ByteStringFactory factory, int[] bytes, boolean not) { in assertValidUtf8() argument
144 byte[] realBytes = toByteArray(bytes); in assertValidUtf8()
146 assertTrue(not ^ Utf8.isValidUtf8(realBytes, 0, bytes.length)); in assertValidUtf8()
148 ByteString sub = leaf.substring(0, bytes.length); in assertValidUtf8()
162 private void assertValidUtf8(int... bytes) { in assertValidUtf8() argument
163 assertValidUtf8(LITERAL_FACTORY, bytes, false); in assertValidUtf8()
[all …]
DIsValidUtf8TestUtil.java65 ByteString newByteString(byte[] bytes); in newByteString() argument
70 public ByteString newByteString(byte[] bytes) {
71 return ByteString.wrap(bytes);
77 public ByteString newByteString(byte[] bytes) {
78 return new NioByteString(ByteBuffer.wrap(bytes));
93 public ByteString newByteString(byte[] bytes) {
96 if (buffer == null || buffer.capacity() < bytes.length) {
97 buffer = ByteBuffer.allocateDirect(bytes.length);
101 buffer.put(bytes);
249 byte[] bytes = new byte[numBytes];
[all …]
DCodedInputStreamTest.java59 private byte[] bytes(int... bytesAsInts) { in bytes() method in CodedInputStreamTest
60 byte[] bytes = new byte[bytesAsInts.length]; in bytes()
62 bytes[i] = (byte) bytesAsInts[i]; in bytes()
64 return bytes; in bytes()
198 assertReadVarint(bytes(0x00), 0); in testReadVarint()
199 assertReadVarint(bytes(0x01), 1); in testReadVarint()
200 assertReadVarint(bytes(0x7f), 127); in testReadVarint()
202 assertReadVarint(bytes(0xa2, 0x74), (0x22 << 0) | (0x74 << 7)); in testReadVarint()
204 assertReadVarint(bytes(0xbe, 0xf7, 0x92, 0x84, 0x0b), in testReadVarint()
210 assertReadVarint(bytes(0xbe, 0xf7, 0x92, 0x84, 0x1b), in testReadVarint()
[all …]
/frameworks/rs/
DrsFifoSocket.cpp52 bool FifoSocket::writeAsync(const void *data, size_t bytes, bool waitForSpace) { in writeAsync() argument
53 if (bytes == 0) { in writeAsync()
57 size_t ret = ::send(sv[0], data, bytes, 0); in writeAsync()
58 rsAssert(ret == bytes); in writeAsync()
59 if (ret != bytes) { in writeAsync()
60 ALOGE("writeAsync %p %zu ret %zu", data, bytes, ret); in writeAsync()
76 size_t FifoSocket::read(void *data, size_t bytes) { in read() argument
82 size_t ret = ::recv(sv[1], data, bytes, MSG_WAITALL); in read()
83 rsAssert(ret == bytes || mShutdown); in read()
101 void FifoSocket::readReturn(const void *data, size_t bytes) { in readReturn() argument
[all …]
/frameworks/base/core/java/android/util/
DByteStringUtils.java37 public static String toHexString(byte[] bytes) { in toHexString() argument
38 if (bytes == null || bytes.length == 0 || bytes.length % 2 != 0) { in toHexString()
42 final int byteLength = bytes.length; in toHexString()
47 final int byteHex = bytes[i] & 0xFF; in toHexString()
66 final byte[] bytes = new byte[charLength / 2]; in fromHexToByteArray()
68 for (int i = 0; i < bytes.length; i++) { in fromHexToByteArray()
69 bytes[i] = in fromHexToByteArray()
73 return bytes; in fromHexToByteArray()
/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/javanano/src/main/java/com/google/protobuf/nano/
DUnknownFieldData.java49 final byte[] bytes; field in UnknownFieldData
51 UnknownFieldData(int tag, byte[] bytes) { in UnknownFieldData() argument
53 this.bytes = bytes; in UnknownFieldData()
59 size += bytes.length; in computeSerializedSize()
65 output.writeRawBytes(bytes); in writeTo()
78 return tag == other.tag && Arrays.equals(bytes, other.bytes); in equals()
85 result = 31 * result + Arrays.hashCode(bytes); in hashCode()
/frameworks/opt/telephony/src/java/com/google/android/mms/pdu/
DQuotedPrintable.java39 public static final byte[] decodeQuotedPrintable(byte[] bytes) { in decodeQuotedPrintable() argument
40 if (bytes == null) { in decodeQuotedPrintable()
44 for (int i = 0; i < bytes.length; i++) { in decodeQuotedPrintable()
45 int b = bytes[i]; in decodeQuotedPrintable()
48 if('\r' == (char)bytes[i + 1] && in decodeQuotedPrintable()
49 '\n' == (char)bytes[i + 2]) { in decodeQuotedPrintable()
53 int u = Character.digit((char) bytes[++i], 16); in decodeQuotedPrintable()
54 int l = Character.digit((char) bytes[++i], 16); in decodeQuotedPrintable()
/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/java/core/src/main/java/com/google/protobuf/
DInternal.java90 public static String stringDefaultValue(String bytes) { in stringDefaultValue() argument
91 return new String(bytes.getBytes(ISO_8859_1), UTF_8); in stringDefaultValue()
102 public static ByteString bytesDefaultValue(String bytes) { in bytesDefaultValue() argument
103 return ByteString.copyFrom(bytes.getBytes(ISO_8859_1)); in bytesDefaultValue()
111 public static byte[] byteArrayDefaultValue(String bytes) { in byteArrayDefaultValue() argument
112 return bytes.getBytes(ISO_8859_1); in byteArrayDefaultValue()
121 public static ByteBuffer byteBufferDefaultValue(String bytes) { in byteBufferDefaultValue() argument
122 return ByteBuffer.wrap(byteArrayDefaultValue(bytes)); in byteBufferDefaultValue()
193 public static String toStringUtf8(byte[] bytes) { in toStringUtf8() argument
194 return new String(bytes, UTF_8); in toStringUtf8()
[all …]
DUtf8.java151 public static boolean isValidUtf8(byte[] bytes) { in isValidUtf8() argument
152 return processor.isValidUtf8(bytes, 0, bytes.length); in isValidUtf8()
164 public static boolean isValidUtf8(byte[] bytes, int index, int limit) { in isValidUtf8() argument
165 return processor.isValidUtf8(bytes, index, limit); in isValidUtf8()
186 public static int partialIsValidUtf8(int state, byte[] bytes, int index, int limit) { in partialIsValidUtf8() argument
187 return processor.partialIsValidUtf8(state, bytes, index, limit); in partialIsValidUtf8()
208 private static int incompleteStateFor(byte[] bytes, int index, int limit) { in incompleteStateFor() argument
209 int byte1 = bytes[index - 1]; in incompleteStateFor()
212 case 1: return incompleteStateFor(byte1, bytes[index]); in incompleteStateFor()
213 case 2: return incompleteStateFor(byte1, bytes[index], bytes[index + 1]); in incompleteStateFor()
[all …]
DByteString.java106 byte[] copyFrom(byte[] bytes, int offset, int size); in copyFrom() argument
112 public byte[] copyFrom(byte[] bytes, int offset, int size) { in copyFrom() argument
114 System.arraycopy(bytes, offset, copy, 0, size); in copyFrom()
122 public byte[] copyFrom(byte[] bytes, int offset, int size) { in copyFrom() argument
123 return Arrays.copyOfRange(bytes, offset, offset + size); in copyFrom()
299 public static ByteString copyFrom(byte[] bytes, int offset, int size) { in copyFrom() argument
300 return new LiteralByteString(byteArrayCopier.copyFrom(bytes, offset, size)); in copyFrom()
309 public static ByteString copyFrom(byte[] bytes) { in copyFrom() argument
310 return copyFrom(bytes, 0, bytes.length); in copyFrom()
317 static ByteString wrap(byte[] bytes) { in wrap() argument
[all …]
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/util/
DInformationElementUtilTest.java118 TEST_SSID_BYTES, results[0].bytes); in parseInformationElements_withSingleElement()
141 TEST_SSID_BYTES, results[0].bytes); in parseInformationElements_withExtraPadding()
164 TEST_SSID_BYTES, results[0].bytes); in parseInformationElements_secondElementInvalidLength()
185 TEST_SSID_BYTES, results[0].bytes); in parseInformationElements_twoElements()
188 assertEquals("second element should have data of length 1", 1, results[1].bytes.length); in parseInformationElements_twoElements()
190 (byte) 0x08, results[1].bytes[0]); in parseInformationElements_twoElements()
211 assertEquals("First element should be length 0", 0, results[0].bytes.length); in parseInformationElements_firstElementZeroLength()
215 TEST_SSID_BYTES, results[1].bytes); in parseInformationElements_firstElementZeroLength()
241 assertEquals("First result should have data of 1 byte", 1, results[0].bytes.length); in parseInformationElements_firstElementWrongLength()
243 invalidLengthTagWithSSIDBytes[2], results[0].bytes[0]); in parseInformationElements_firstElementWrongLength()
[all …]
/frameworks/base/core/java/com/android/internal/util/
DCharSequences.java32 public static CharSequence forAsciiBytes(final byte[] bytes) { in forAsciiBytes() argument
35 return (char) bytes[index]; in forAsciiBytes()
39 return bytes.length; in forAsciiBytes()
43 return forAsciiBytes(bytes, start, end); in forAsciiBytes()
47 return new String(bytes); in forAsciiBytes()
63 public static CharSequence forAsciiBytes(final byte[] bytes,
65 validate(start, end, bytes.length);
68 return (char) bytes[index + start];
79 return forAsciiBytes(bytes, newStart, newEnd);
83 return new String(bytes, start, length());
/frameworks/layoutlib/bridge/src/dalvik/system/
DVMRuntime_Delegate.java39 int bytes = 20 + (2 * minLength); in newUnpaddedArray() local
40 int alignedUpBytes = (bytes + 7) & -8; in newUnpaddedArray()
48 int bytes = 20 + minLength; in newUnpaddedArray() local
49 int alignedUpBytes = (bytes + 7) & -8; in newUnpaddedArray()
54 int bytes = 20 + minLength; in newUnpaddedArray() local
55 int alignedUpBytes = (bytes + 7) & -8; in newUnpaddedArray()
60 int bytes = 20 + (2 * minLength); in newUnpaddedArray() local
61 int alignedUpBytes = (bytes + 7) & -8; in newUnpaddedArray()
/frameworks/base/core/java/android/bluetooth/
DUidTraffic.java54 public void setRxBytes(long bytes) { in setRxBytes() argument
55 mRxBytes = bytes; in setRxBytes()
58 public void setTxBytes(long bytes) { in setTxBytes() argument
59 mTxBytes = bytes; in setTxBytes()
62 public void addRxBytes(long bytes) { in addRxBytes() argument
63 mRxBytes += bytes; in addRxBytes()
66 public void addTxBytes(long bytes) { in addTxBytes() argument
67 mTxBytes += bytes; in addTxBytes()
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/util/
DInformationElementUtil.java35 public static InformationElement[] parseInformationElements(byte[] bytes) { in parseInformationElements() argument
36 if (bytes == null) { in parseInformationElements()
39 ByteBuffer data = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); in parseInformationElements()
60 ie.bytes = new byte[elementLength]; in parseInformationElements()
61 data.get(ie.bytes); in parseInformationElements()
142 if (ie.bytes.length != 5) { in from()
144 + ie.bytes.length); in from()
146 ByteBuffer data = ByteBuffer.wrap(ie.bytes).order(ByteOrder.LITTLE_ENDIAN); in from()
184 secondChannelOffset = ie.bytes[1] & 0x3; in from()
218 channelMode = ie.bytes[0] & Constants.BYTE_MASK; in from()
[all …]
/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/src/google/protobuf/stubs/
Dbytestream.cc70 void CheckedArrayByteSink::Append(const char* bytes, size_t n) { in Append() argument
76 if (n > 0 && bytes != (outbuf_ + size_)) { in Append()
78 GOOGLE_DCHECK(!(outbuf_ <= bytes && bytes < (outbuf_ + capacity_))) in Append()
80 memcpy(outbuf_ + size_, bytes, n); in Append()
95 void GrowingArrayByteSink::Append(const char* bytes, size_t n) { in Append() argument
97 if (bytes != (buf_ + size_)) { in Append()
100 GOOGLE_DCHECK(!(buf_ <= bytes && bytes < (buf_ + capacity_))) in Append()
106 if (n > 0 && bytes != (buf_ + size_)) { in Append()
107 memcpy(buf_ + size_, bytes, n); in Append()
/frameworks/opt/gamesdk/third_party/protobuf-3.0.0/js/binary/
Ddecoder.js547 var bytes = this.bytes_;
549 temp = bytes[this.cursor_ + 0];
557 temp = bytes[this.cursor_ + 1];
565 temp = bytes[this.cursor_ + 2];
573 temp = bytes[this.cursor_ + 3];
581 temp = bytes[this.cursor_ + 4];
599 goog.asserts.assert(bytes[this.cursor_ + 5] == 0xFF);
600 goog.asserts.assert(bytes[this.cursor_ + 6] == 0xFF);
601 goog.asserts.assert(bytes[this.cursor_ + 7] == 0xFF);
602 goog.asserts.assert(bytes[this.cursor_ + 8] == 0xFF);
[all …]

12345678910>>...21