Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 339) sorted by relevance

12345678910>>...14

/cts/tests/tests/proto/src/android/util/proto/cts/
DEncodedBufferTest.java48 EncodedBuffer buffer; in testWriteRawByteWrapsChunks() local
50 buffer = new EncodedBuffer(1); in testWriteRawByteWrapsChunks()
52 buffer.writeRawByte((byte)i); in testWriteRawByteWrapsChunks()
54 assertEquals(100, buffer.getChunkCount()); in testWriteRawByteWrapsChunks()
55 assertEquals(99, buffer.getWriteBufIndex()); in testWriteRawByteWrapsChunks()
56 assertEquals(1, buffer.getWriteIndex()); in testWriteRawByteWrapsChunks()
58 buffer = new EncodedBuffer(50); in testWriteRawByteWrapsChunks()
60 buffer.writeRawByte((byte)i); in testWriteRawByteWrapsChunks()
62 assertEquals(2, buffer.getChunkCount()); in testWriteRawByteWrapsChunks()
63 assertEquals(1, buffer.getWriteBufIndex()); in testWriteRawByteWrapsChunks()
[all …]
/cts/tests/tests/hardware/src/android/hardware/cts/
DHardwareBufferTest.java48 private static native void nativeWriteHardwareBuffer(HardwareBuffer buffer, Parcel parcel); in nativeWriteHardwareBuffer() argument
56 HardwareBuffer buffer = HardwareBuffer.create(2, 4, HardwareBuffer.RGBA_8888, 1, in testCreate() local
58 assertTrue(buffer != null); in testCreate()
59 assertEquals(2, buffer.getWidth()); in testCreate()
60 assertEquals(4, buffer.getHeight()); in testCreate()
61 assertEquals(HardwareBuffer.RGBA_8888, buffer.getFormat()); in testCreate()
62 assertEquals(1, buffer.getLayers()); in testCreate()
63 assertEquals(HardwareBuffer.USAGE_CPU_READ_RARELY, buffer.getUsage()); in testCreate()
65 buffer = HardwareBuffer.create(2, 4, HardwareBuffer.RGBX_8888, 1, in testCreate()
67 assertEquals(HardwareBuffer.RGBX_8888, buffer.getFormat()); in testCreate()
[all …]
/cts/tools/release-parser/src/com/android/cts/releaseparser/
DArtParser.java63 byte[] buffer = new byte[HEADER_SIZE]; in parse()
71 raFile.readFully(buffer, 0, HEADER_SIZE); in parse()
74 if (buffer[0] != ART_MAGIC[0] in parse()
75 || buffer[1] != ART_MAGIC[1] in parse()
76 || buffer[2] != ART_MAGIC[2] in parse()
77 || buffer[3] != ART_MAGIC[3]) { in parse()
78 String content = new String(buffer); in parse()
85 mArtInfoBuilder.setVersion(new String(Arrays.copyOfRange(buffer, offset, offset + 4))); in parse()
87 mArtInfoBuilder.setImageBegin(getIntLittleEndian(buffer, offset)); in parse()
89 mArtInfoBuilder.setImageSize(getIntLittleEndian(buffer, offset)); in parse()
[all …]
DOatParser.java94 private void praseOat(byte[] buffer) throws IllegalArgumentException { in praseOat() argument
95 if (buffer[0] != OAT_MAGIC[0] in praseOat()
96 || buffer[1] != OAT_MAGIC[1] in praseOat()
97 || buffer[2] != OAT_MAGIC[2] in praseOat()
98 || buffer[3] != OAT_MAGIC[3]) { in praseOat()
99 String content = new String(buffer); in praseOat()
105 String version = new String(Arrays.copyOfRange(buffer, offset, offset + 4)); in praseOat()
108 mOatInfoBuilder.setAdler32Checksum(getIntLittleEndian(buffer, offset)); in praseOat()
110 mOatInfoBuilder.setInstructionSet(getIntLittleEndian(buffer, offset)); in praseOat()
112 mOatInfoBuilder.setInstructionSetFeaturesBitmap(getIntLittleEndian(buffer, offset)); in praseOat()
[all …]
DVdexParser.java63 byte[] buffer = new byte[HEADER_SIZE]; in parse()
69 raFile.readFully(buffer, 0, HEADER_SIZE); in parse()
74 if (buffer[0] != VDEX_MAGIC[0] in parse()
75 || buffer[1] != VDEX_MAGIC[1] in parse()
76 || buffer[2] != VDEX_MAGIC[2] in parse()
77 || buffer[3] != VDEX_MAGIC[3]) { in parse()
78 String content = new String(buffer); in parse()
83 String version = new String(Arrays.copyOfRange(buffer, offset, offset + 4)); in parse()
86 String dex_section_version = new String(Arrays.copyOfRange(buffer, offset, offset + 4)); in parse()
89 int numberOfDexFiles = getIntLittleEndian(buffer, offset); in parse()
[all …]
/cts/tests/tests/text/src/android/text/cts/
DFontFileTestUtil.java38 ByteBuffer buffer = fc.map(FileChannel.MapMode.READ_ONLY, 0, size) in getPostScriptName() local
40 return getPostScriptName(buffer, index); in getPostScriptName()
46 public static String getPostScriptName(ByteBuffer buffer, int index) throws IOException { in getPostScriptName() argument
47 int magicNumber = buffer.getInt(0); in getPostScriptName()
50 int numFonts = buffer.getInt(8); in getPostScriptName()
56 fontOffset = buffer.getInt(12 + 4 * index); in getPostScriptName()
57 magicNumber = buffer.getInt(fontOffset); in getPostScriptName()
65 int numTables = buffer.getShort(fontOffset + 4); // offset to number of table in getPostScriptName()
69 int tableTag = buffer.getInt(tableEntryOffset); in getPostScriptName()
71 nameTableOffset = buffer.getInt(tableEntryOffset + 8); in getPostScriptName()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/audio/audiolib/
DCircularBufferFloat.java35 public int write(float[] buffer) { in write() argument
36 return write(buffer, 0, buffer.length); in write()
46 public int write(float[] buffer, int offset, int numSamples) { in write() argument
53 System.arraycopy(buffer, offset, mData, mCursor, numWrite1); in write()
56 System.arraycopy(buffer, offset, mData, 0, numWrite2); in write()
59 System.arraycopy(buffer, offset, mData, mCursor, numSamples); in write()
77 public int readMostRecent(float[] buffer) { in readMostRecent() argument
78 return readMostRecent(buffer, 0, buffer.length); in readMostRecent()
88 public int readMostRecent(float[] buffer, int offset, int numSamples) { in readMostRecent() argument
97 System.arraycopy(mData, mData.length - numRead1, buffer, offset, numRead1); in readMostRecent()
[all …]
/cts/tests/tests/nativehardware/src/android/hardware/nativehardware/cts/
DHardwareBufferVrTest.java46 HardwareBuffer buffer = HardwareBuffer.create(2, 4, format, 2, flags); in testLayeredBuffersForVr() local
47 assertEquals(2, buffer.getWidth()); in testLayeredBuffersForVr()
48 assertEquals(4, buffer.getHeight()); in testLayeredBuffersForVr()
49 assertEquals(2, buffer.getLayers()); in testLayeredBuffersForVr()
50 assertEquals(format, buffer.getFormat()); in testLayeredBuffersForVr()
51 assertEquals(flags, buffer.getUsage()); in testLayeredBuffersForVr()
53 buffer = HardwareBuffer.create(345, 231, format, 5, flags); in testLayeredBuffersForVr()
54 assertEquals(345, buffer.getWidth()); in testLayeredBuffersForVr()
55 assertEquals(231, buffer.getHeight()); in testLayeredBuffersForVr()
56 assertEquals(5, buffer.getLayers()); in testLayeredBuffersForVr()
[all …]
/cts/tests/tests/nativehardware/jni/
DAHardwareBufferTest.cpp128 AHardwareBuffer_Desc GetDescription(AHardwareBuffer* buffer) { in GetDescription() argument
130 AHardwareBuffer_describe(buffer, &description); in GetDescription()
161 AHardwareBuffer* buffer; in TEST() local
168 res = AHardwareBuffer_allocate((AHardwareBuffer_Desc* _Nonnull)NULL, &buffer); in TEST()
177 AHardwareBuffer* buffer; in TEST() local
185 int res = AHardwareBuffer_allocate(&desc, &buffer); in TEST()
189 res = AHardwareBuffer_allocate(&desc, &buffer); in TEST()
191 EXPECT_EQ(desc, GetDescription(buffer)); in TEST()
192 AHardwareBuffer_release(buffer); in TEST()
193 buffer = NULL; in TEST()
[all …]
/cts/tests/tests/graphics/src/android/graphics/fonts/
DFontFileTestUtil.java39 ByteBuffer buffer = fc.map(FileChannel.MapMode.READ_ONLY, 0, size) in getPostScriptName() local
42 int magicNumber = buffer.getInt(0); in getPostScriptName()
46 fontOffset = buffer.getInt(12); // 0th offset in getPostScriptName()
47 magicNumber = buffer.getInt(fontOffset); in getPostScriptName()
55 int numTables = buffer.getShort(fontOffset + 4); // offset to number of table in getPostScriptName()
59 int tableTag = buffer.getInt(tableEntryOffset); in getPostScriptName()
61 nameTableOffset = buffer.getInt(tableEntryOffset + 8); in getPostScriptName()
70 int nameTableCount = buffer.getShort(nameTableOffset + 2); in getPostScriptName()
71 int storageOffset = buffer.getShort(nameTableOffset + 4); in getPostScriptName()
74 int platformID = buffer.getShort(nameTableOffset + 6 + i * 12); in getPostScriptName()
[all …]
/cts/tests/location/location_gnss/src/android/location/cts/gnss/asn1/base/
DBitStream.java39 private byte[] buffer = new byte[BUFFER_CHUNK]; field in BitStream
50 return Arrays.copyOf(buffer, position + (setBits == 0 ? 0 : 1)); in getPaddedBytes()
54 buffer[position] = (byte) (buffer[position] | (data & 0xFF) >> setBits); in appendByte()
56 buffer[position] = (byte) (buffer[position] | (data << (BITS_IN_BYTE - setBits)) & 0xFF); in appendByte()
61 if (position >= buffer.length) { in incrementPosition()
62 buffer = Arrays.copyOf(buffer, buffer.length + BUFFER_CHUNK); in incrementPosition()
68 buffer[position] = (byte) (buffer[position] | 1 << (BITS_IN_BYTE - 1 - setBits)); in appendBit()
DBitStreamReader.java28 private final byte[] buffer; field in BitStreamReader
33 buffer = bytes; in BitStreamReader()
46 return ((buffer[position] >> (BITS_IN_BYTE - bitsRead)) & 1) == 1; in readBit()
53 return position + 1 < buffer.length in hasBit()
54 || (bitsRead < BITS_IN_BYTE && position < buffer.length); in hasBit()
71 byte result = (byte) ((buffer[position] & mask) << bitsRead); in readByte()
74 result = (byte) (result | (buffer[position] & 0xFF) >>> (8 - bitsRead)); in readByte()
/cts/libs/json/src/com/android/json/stream/
DJsonReader.java187 private final char[] buffer = new char[1024]; field in JsonReader
650 if ((pos < limit || fillBuffer(1)) && buffer[pos] == '>') { in objectValue()
693 System.arraycopy(buffer, pos, buffer, 0, limit); in fillBuffer()
700 while ((total = in.read(buffer, limit, buffer.length - limit)) != -1) { in fillBuffer()
711 int c = buffer[pos++]; in nextNonWhitespace()
725 char peek = buffer[pos]; in nextNonWhitespace()
777 char c = buffer[pos++]; in skipToEndOfLine()
788 if (buffer[pos + c] != toFind.charAt(c)) { in skipTo()
813 int c = buffer[pos++]; in nextString()
819 return new String(buffer, start, pos - start - 1); in nextString()
[all …]
/cts/tests/tests/os/src/android/os/cts/
DSharedMemoryTest.java116 ByteBuffer buffer = sharedMemory.mapReadWrite(); in testReadWrite() local
120 buffer.put(0, expected); in testReadWrite()
121 assertEquals(expected, buffer.get(0)); in testReadWrite()
129 assertEquals(expected, buffer.get(0)); in testReadWrite()
130 SharedMemory.unmap(buffer); in testReadWrite()
137 ByteBuffer buffer = sharedMemory.mapReadWrite(); in testReadOnly() local
142 buffer.put(0, expected); in testReadOnly()
143 assertEquals(expected, buffer.get(0)); in testReadOnly()
153 buffer.put(0, expected); in testReadOnly()
154 assertEquals(expected, buffer.get(0)); in testReadOnly()
[all …]
/cts/apps/CtsVerifier/src/org/hyphonate/megaaudio/player/sources/
DWaveTableSource.java115 public int pull(float[] buffer, int numFrames, int numChans) { in pull() argument
133 buffer[outIndex++] = value; in pull()
150 public static void genSinWave(float[] buffer) { in genSinWave() argument
151 int size = buffer.length; in genSinWave()
154 float incr = ((float) Math.PI * 2.0f) / (float) (buffer.length - 1); in genSinWave()
156 buffer[index] = (float)Math.sin(index * incr); in genSinWave()
168 float[] buffer, float maxValue, float minValue, float dutyCycle) { in genTriangleWave() argument
172 int size = buffer.length - 1; in genTriangleWave()
184 buffer[index] = val; in genTriangleWave()
195 buffer[index] = val; in genTriangleWave()
[all …]
/cts/tests/tests/content/src/android/content/res/cts/
DAssetManager_AssetInputStreamTest.java104 byte[] buffer = new byte[10]; in testByteArrayRead()
105 assertEquals(10, mAssetInputStream.read(buffer)); in testByteArrayRead()
107 assertEquals(EXPECTED_BYTES[i], buffer[i]); in testByteArrayRead()
110 buffer = new byte[5]; in testByteArrayRead()
111 assertEquals(5, mAssetInputStream.read(buffer)); in testByteArrayRead()
113 assertEquals(EXPECTED_BYTES[10 + i], buffer[i]); in testByteArrayRead()
117 buffer = new byte[EXPECTED_BYTES.length - 15]; in testByteArrayRead()
118 assertEquals(buffer.length, mAssetInputStream.read(buffer)); in testByteArrayRead()
119 assertEquals(-1, mAssetInputStream.read(buffer)); in testByteArrayRead()
125 byte[] buffer = new byte[15]; in testByteArrayReadOffset()
[all …]
DRawResourceTest.java60 final byte[] buffer = new byte[10]; in verifyTextAsset()
64 while ((readCount = is.read(buffer, 0, buffer.length)) > 0) { in verifyTextAsset()
68 + " but found " + ((char) buffer[i]), in verifyTextAsset()
69 buffer[i], expectedString.charAt(curIndex)); in verifyTextAsset()
74 readCount = is.read(buffer, 0, buffer.length); in verifyTextAsset()
78 readCount = is.read(buffer, buffer.length, 0); in verifyTextAsset()
/cts/apps/CtsVerifierUSBCompanion/src/com/android/cts/verifierusbcompanion/
DAccessoryTestCompanion.java131 byte[] buffer = new byte[32]; in runTest()
133 int numTransferred = connection.bulkTransfer(in, buffer, 32, 0); in runTest()
136 numTransferred = connection.bulkTransfer(out, buffer, 32, 0); in runTest()
142 byte[] buffer = new byte[48]; in runTest()
145 int numTransferred = connection.bulkTransfer(in, buffer, 32, 0); in runTest()
147 numTransferred = connection.bulkTransfer(in, buffer, 16, 32, 0); in runTest()
150 numTransferred = connection.bulkTransfer(out, buffer, 32, 0); in runTest()
156 byte[] buffer = new byte[32]; in runTest()
158 int numTransferred = connection.bulkTransfer(in, buffer, 32, 0); in runTest()
161 numTransferred = connection.bulkTransfer(out, buffer, 16, 0); in runTest()
[all …]
DAoapInterface.java91 byte[] buffer = new byte[2]; in getProtocol()
94 AoapInterface.ACCESSORY_GET_PROTOCOL, 0, 0, buffer, 2, 10000); in getProtocol()
98 return (buffer[1] << 8) | buffer[0]; in getProtocol()
102 byte[] buffer = (string + "\0").getBytes(); in sendString()
106 buffer, buffer.length, 10000); in sendString()
107 if (len != buffer.length) { in sendString()
/cts/apps/CtsVerifier/jni/megaaudio/player/
DWaveTableSource.cpp59 int WaveTableSource::pull(float* buffer, int numFrames, int numChans) { in pull() argument
77 buffer[outIndex++] = value; in pull()
89 void WaveTableSource::genSinWave(float* buffer, int length) { in genSinWave() argument
92 buffer[index] = sinf(index * incr); in genSinWave()
96 void WaveTableSource::genTriangleWave(float* buffer, int size, in genTriangleWave() argument
110 buffer[index] = val; in genTriangleWave()
121 buffer[index] = val; in genTriangleWave()
129 buffer[index] = val; in genTriangleWave()
135 void WaveTableSource::genPulseWave(float* buffer, int size, in genPulseWave() argument
140 buffer[index] = maxValue; in genPulseWave()
[all …]
/cts/tests/tests/hardware/jni/
Dandroid_hardware_cts_HardwareBufferTest.cpp32 AHardwareBuffer* buffer = NULL; in android_hardware_HardwareBuffer_nativeCreateHardwareBuffer() local
40 int res = AHardwareBuffer_allocate(&desc, &buffer); in android_hardware_HardwareBuffer_nativeCreateHardwareBuffer()
44 jobject ret = AHardwareBuffer_toHardwareBuffer(env, buffer); in android_hardware_HardwareBuffer_nativeCreateHardwareBuffer()
45 AHardwareBuffer_release(buffer); in android_hardware_HardwareBuffer_nativeCreateHardwareBuffer()
60 AHardwareBuffer* buffer; in android_hardware_HardwareBuffer_nativeReadHardwareBuffer() local
61 binder_status_t status = AHardwareBuffer_readFromParcel(parcel, &buffer); in android_hardware_HardwareBuffer_nativeReadHardwareBuffer()
69 jobject ret = AHardwareBuffer_toHardwareBuffer(env, buffer); in android_hardware_HardwareBuffer_nativeReadHardwareBuffer()
70 AHardwareBuffer_release(buffer); in android_hardware_HardwareBuffer_nativeReadHardwareBuffer()
76 AHardwareBuffer* buffer = AHardwareBuffer_fromHardwareBuffer(env, hardwareBufferObj); in android_hardware_HardwareBuffer_nativeWriteHardwareBuffer() local
78 binder_status_t status = AHardwareBuffer_writeToParcel(buffer, parcel); in android_hardware_HardwareBuffer_nativeWriteHardwareBuffer()
/cts/tests/tests/nativemidi/java/android/nativemidi/cts/
DNativeMidiEchoTest.java89 byte[] buffer = new byte[len]; in generateRandomMessage()
91 buffer[index] = (byte)(mRandom.nextInt() & 0xFF); in generateRandomMessage()
93 return buffer; in generateRandomMessage()
106 private void compareMessages(byte[] buffer, long timestamp, NativeMidiMessage nativeMsg) { in compareMessages() argument
107 Assert.assertEquals("byte count of message", buffer.length, nativeMsg.len); in compareMessages()
110 for (int index = 0; index < buffer.length; index++) { in compareMessages()
111 Assert.assertEquals("message byte[" + index + "]", buffer[index] & 0x0FF, in compareMessages()
112 nativeMsg.buffer[index] & 0x0FF); in compareMessages()
269 final byte[] buffer = { in test_B_SendData()
273 writeMidi(mTestContext, buffer, 0, buffer.length); in test_B_SendData()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/usb/device/
DAoapInterface.java96 byte buffer[] = new byte[2]; in getProtocol()
99 AoapInterface.ACCESSORY_GET_PROTOCOL, 0, 0, buffer, 2, 10000); in getProtocol()
103 return (buffer[1] << 8) | buffer[0]; in getProtocol()
107 byte[] buffer = (string + "\0").getBytes(); in sendString()
111 buffer, buffer.length, 10000); in sendString()
112 if (len != buffer.length) { in sendString()
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2016-2412/
Dpoc.cpp32 char buffer[16] = {0}; in writeParcelableHead() local
33 snprintf(buffer, 16, "%d", count); in writeParcelableHead()
35 pData->writeString16(String16((const char *)buffer)); in writeParcelableHead()
48 char buffer[100]; in writeRegion() local
49 memset(buffer, 0xcc, in writeRegion()
50 sizeof(buffer)); // this buffer will be used to corrrupt the heap in writeRegion()
51 pData->write(buffer, sizeof(buffer)); in writeRegion()
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2022-20147/
Dpoc.cpp54 uint8_t *buffer = (uint8_t *)malloc(kBufferSize * sizeof(uint8_t)); in main() local
55 FAIL_CHECK(buffer); in main()
56 buffer[0] = NFC_PMID_ATR_RES_GEN_BYTES; in main()
57 buffer[1] = kLengthVal; in main()
60 nfa_dm_check_set_config(kBufferSize, buffer, false); in main()
64 free(buffer); in main()

12345678910>>...14