Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 62) sorted by relevance

123

/cts/hostsidetests/net/app/src/com/android/cts/net/hostside/
DPacketReflector.java64 private static void swapBytes(byte[] buf, int pos1, int pos2, int len) { in swapBytes() argument
66 byte b = buf[pos1 + i]; in swapBytes()
67 buf[pos1 + i] = buf[pos2 + i]; in swapBytes()
68 buf[pos2 + i] = b; in swapBytes()
72 private static void swapAddresses(byte[] buf, int version) { in swapAddresses() argument
86 swapBytes(buf, addrPos, addrPos + addrLen, addrLen); in swapAddresses()
91 private void processTcpPacket(byte[] buf, int version, int len, int hdrLen) { in processTcpPacket() argument
97 swapAddresses(buf, version); in processTcpPacket()
100 writePacket(buf, len); in processTcpPacket()
105 private void processUdpPacket(byte[] buf, int version, int len, int hdrLen) { in processUdpPacket() argument
[all …]
/cts/tests/tests/net/jni/
DNativeDnsJni.c45 char buf[256]; in Java_android_net_cts_DnsTest_testNativeDns() local
48 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns()
50 ALOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns()
53 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns()
55 ALOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns()
78 char buf[256]; in Java_android_net_cts_DnsTest_testNativeDns() local
81 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns()
82 ALOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns()
86 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns()
87 ALOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns()
[all …]
DNativeMultinetworkJni.c96 char buf[kSockaddrStrLen+1]; in sockaddr_ntop() local
103 snprintf(buf, sizeof(buf), in sockaddr_ntop()
107 sprintf(buf, "???"); in sockaddr_ntop()
110 strlcpy(dst, buf, size); in sockaddr_ntop()
/cts/tests/tests/content/src/android/content/res/cts/
DAssetFileDescriptor_AutoCloseInputStreamTest.java90 byte[] buf = new byte[FILE_LENGTH]; in testReadBufferLen()
91 assertEquals(3, mInput.read(buf, 0, 3)); in testReadBufferLen()
92 assertEquals(3, mInput.read(buf, 3, 3)); in testReadBufferLen()
93 assertEquals(3, mInput.read(buf, 6, 4)); in testReadBufferLen()
94 MoreAsserts.assertEquals(FILE_DATA, buf); in testReadBufferLen()
95 assertEquals(FILE_END, mInput.read(buf, 0, 4)); in testReadBufferLen()
100 byte[] buf = new byte[6]; in testReadBuffer()
101 assertEquals(6, mInput.read(buf)); in testReadBuffer()
102 assertEquals(FILE_DATA[0], buf[0]); in testReadBuffer()
103 assertEquals(3, mInput.read(buf)); in testReadBuffer()
[all …]
/cts/tests/tests/media/libmediandkjni/
Dmd5_utils.cpp28 byteSwap(UWORD32 *buf, unsigned words) { in byteSwap() argument
37 p = (md5byte *)buf; in byteSwap()
40 *buf++ = (UWORD32)((unsigned)p[3] << 8 | p[2]) << 16 | in byteSwap()
52 ctx->buf[0] = 0x67452301; in MD5Init()
53 ctx->buf[1] = 0xefcdab89; in MD5Init()
54 ctx->buf[2] = 0x98badcfe; in MD5Init()
55 ctx->buf[3] = 0x10325476; in MD5Init()
66 MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len) { in MD5Update() argument
79 memcpy((md5byte *)ctx->in + 64 - t, buf, len); in MD5Update()
84 memcpy((md5byte *)ctx->in + 64 - t, buf, t); in MD5Update()
[all …]
Dmd5_utils.h35 UWORD32 buf[4]; member
41 void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len);
43 void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]);
Dnative-media-jni.cpp119 uint8_t *buf = new uint8_t[bufsize]; in testExtractor() local
121 int n = AMediaExtractor_readSampleData(ex, buf, bufsize); in testExtractor()
143 delete[] buf; in testExtractor()
269 uint8_t *buf = AMediaCodec_getInputBuffer(codec[t], bufidx, &bufsize); in Java_android_media_cts_NativeDecoderTest_getDecodedDataNative() local
270 int sampleSize = AMediaExtractor_readSampleData(ex, buf, bufsize); in Java_android_media_cts_NativeDecoderTest_getDecodedDataNative()
315 uint8_t *buf = AMediaCodec_getOutputBuffer(codec[tt], status, &bufsize); in Java_android_media_cts_NativeDecoderTest_getDecodedDataNative() local
316 int adler = checksum(buf, info.size, format[tt]); in Java_android_media_cts_NativeDecoderTest_getDecodedDataNative()
414 uint8_t *buf = AMediaCodec_getInputBuffer(codec, bufidx, &bufsize); in Java_android_media_cts_NativeDecoderTest_testPlaybackNative() local
415 int sampleSize = AMediaExtractor_readSampleData(ex, buf, bufsize); in Java_android_media_cts_NativeDecoderTest_testPlaybackNative()
496 uint8_t *buf = new uint8_t[bufsize]; in Java_android_media_cts_NativeDecoderTest_testMuxerNative() local
[all …]
/cts/tests/tests/security/jni/
Dandroid_security_cts_EncryptionTest.cpp43 struct statfs buf; in checkEncryptedFileSystem() local
44 if ((-1 != statfs("/data", &buf)) && in checkEncryptedFileSystem()
45 (buf.f_type == 0xf15f /* ecryptfs */)) { in checkEncryptedFileSystem()
155 uint8_t *buf; in android_security_cts_EncryptionTest_aesIsFast() local
170 buf = new (std::nothrow) uint8_t[TEST_BUFSIZE + in android_security_cts_EncryptionTest_aesIsFast()
173 if (!buf) { in android_security_cts_EncryptionTest_aesIsFast()
179 memset(buf, 0xF0, TEST_BUFSIZE); in android_security_cts_EncryptionTest_aesIsFast()
185 EVP_DecryptUpdate(&ctx, buf, &len, buf, TEST_BUFSIZE); in android_security_cts_EncryptionTest_aesIsFast()
190 delete[] buf; in android_security_cts_EncryptionTest_aesIsFast()
/cts/hostsidetests/devicepolicy/app/VpnApp/src/com/android/cts/vpnfirewall/
DPingReflector.java63 private void processPacket(byte[] buf, int version, int len, int hdrLen) throws IOException { in processPacket() argument
67 DataInputStream stream = new DataInputStream(new ByteArrayInputStream(buf)); in processPacket()
90 private void writePacket(byte[] buf) { in writePacket() argument
92 Os.write(mFd, buf, 0, buf.length); in writePacket()
98 private int readPacket(byte[] buf) { in readPacket() argument
100 return Os.read(mFd, buf, 0, buf.length); in readPacket()
/cts/libs/deviceutil/src/android/cts/util/
DBroadcastUtils.java40 StringBuilder buf = new StringBuilder(); in toBundleString() local
42 buf.append("extras: "); in toBundleString()
44 buf.append("(" + s + " = " + bundle.get(s) + "), "); in toBundleString()
47 return buf.toString(); in toBundleString()
DSystemUtil.java61 byte[] buf = new byte[512]; in runShellCommand()
65 while ((bytesRead = fis.read(buf)) != -1) { in runShellCommand()
66 stdout.append(new String(buf, 0, bytesRead)); in runShellCommand()
/cts/tests/tests/alarmclock/common/src/android/alarmclock/common/
DUtils.java42 StringBuilder buf = new StringBuilder(); in toBundleString() local
44 buf.append("extras: "); in toBundleString()
46 buf.append("(" + s + " = " + bundle.get(s) + "), "); in toBundleString()
49 return buf.toString(); in toBundleString()
/cts/tests/tests/keystore/src/android/keystore/cts/
DHexEncoding.java56 public static String encode(ByteBuffer buf) { in encode() argument
57 return encode(buf.array(), buf.arrayOffset() + buf.position(), buf.remaining()); in encode()
/cts/tests/tests/media/src/android/media/cts/
DCodecUtils.java164 ByteBuffer buf = planes[i].getBuffer(); in getImageMD5Checksum() local
178 if (buf.hasArray()) { in getImageMD5Checksum()
179 byte b[] = buf.array(); in getImageMD5Checksum()
180 int offs = buf.arrayOffset(); in getImageMD5Checksum()
195 int pos = buf.position(); in getImageMD5Checksum()
198 buf.position(pos + y * rowStride); in getImageMD5Checksum()
199 buf.get(bb, y * width, width); in getImageMD5Checksum()
206 buf.position(pos + y * rowStride); in getImageMD5Checksum()
208 buf.get(lb, 0, pixelStride * (width - 1) + 1); in getImageMD5Checksum()
214 buf.position(pos); in getImageMD5Checksum()
DAdaptivePlaybackTest.java757 static long checksum(ByteBuffer buf, int size, CRC32 crc) {
759 assertTrue(size <= buf.capacity());
761 if (buf.hasArray()) {
762 crc.update(buf.array(), buf.arrayOffset(), size);
764 int pos = buf.position();
765 buf.rewind();
771 buf.get(bb, 0, chk);
774 buf.position(pos);
803 static String byteBufferToString(ByteBuffer buf, int start, int len) {
804 int oldPosition = buf.position();
[all …]
/cts/tests/tests/net/src/android/net/cts/
DMultinetworkSysctlTest.java62 byte[] buf = new byte[1024]; in readFile()
64 int bytesRead = Os.read(fd, buf, 0, buf.length); in readFile()
65 assertLess("length of " + fileName + ":", bytesRead, buf.length); in readFile()
66 return new String(buf); in readFile()
/cts/tests/tests/opengl/libopengltest/
Dcolor_one.cpp58 char* buf = (char*) malloc(bufLength); in initColorOne() local
59 if (buf) { in initColorOne()
60 glGetProgramInfoLog(gProgram, bufLength, NULL, buf); in initColorOne()
61 LOGE("Could not link program:\n%s\n", buf); in initColorOne()
62 free(buf); in initColorOne()
/cts/tests/tests/voiceinteraction/common/src/android/voiceinteraction/common/
DUtils.java71 StringBuffer buf = new StringBuffer("Bundle is: "); in toBundleString() local
74 buf.append("testcase type = " + testType); in toBundleString()
79 buf.append(s + "\n\t\t"); in toBundleString()
82 return buf.toString(); in toBundleString()
/cts/tests/tests/renderscript/src/android/renderscript/cts/
Dlarge_global.rs18 char buf[2*1024*1024];
22 buf[0] = c;
/cts/tests/tests/os/src/android/os/cts/
DStrictModeTest.java102 final ByteArrayOutputStream buf = new ByteArrayOutputStream(); in readLogSince() local
103 Streams.copy(proc.getInputStream(), buf); in readLogSince() local
106 Log.d(TAG, "Log output was " + buf.size() + " bytes, exit code " + res); in readLogSince()
107 return new String(buf.toByteArray()); in readLogSince()
/cts/tools/signature-tools/src/signature/converter/doclet/
DDocletFactory.java48 StringBuffer buf = new StringBuffer(); in loadApi() local
50 buf.append(filename); in loadApi()
51 buf.append(":"); in loadApi()
53 String sourcepath = buf.substring(0, buf.length() - 1); in loadApi()
/cts/tests/camera/src/android/hardware/camera2/cts/rs/
Draw_converter.rs195 static void load3x3(uint x, uint y, rs_allocation buf, /*out*/float* outputArray) {
196 outputArray[0] = *((ushort *) rsGetElementAt(buf, x - 1, y - 1));
197 outputArray[1] = *((ushort *) rsGetElementAt(buf, x, y - 1));
198 outputArray[2] = *((ushort *) rsGetElementAt(buf, x + 1, y - 1));
199 outputArray[3] = *((ushort *) rsGetElementAt(buf, x - 1, y));
200 outputArray[4] = *((ushort *) rsGetElementAt(buf, x, y));
201 outputArray[5] = *((ushort *) rsGetElementAt(buf, x + 1, y));
202 outputArray[6] = *((ushort *) rsGetElementAt(buf, x - 1, y + 1));
203 outputArray[7] = *((ushort *) rsGetElementAt(buf, x, y + 1));
204 outputArray[8] = *((ushort *) rsGetElementAt(buf, x + 1, y + 1));
/cts/apps/CameraITS/pymodules/its/
Ddevice.py241 buf = None
244 buf = bytearray(n)
245 view = memoryview(buf)
250 buf = numpy.frombuffer(buf, dtype=numpy.uint8)
251 return jobj, buf
705 jsonObj,buf = self.__read_response_from_socket()
708 and buf is not None:
710 bufs[fmt].append(buf)
713 buf_size = numpy.product(buf.shape)
714 yuv_bufs[buf_size].append(buf)
/cts/tests/tests/os/jni/seccomp-tests/tests/
Dsigsegv.c118 char buf[256]; in TRAP_action() local
131 len = snprintf(buf, sizeof(buf), in TRAP_action()
145 syscall(__NR_write, STDOUT_FILENO, buf, len); in TRAP_action()
/cts/tests/tests/assist/common/src/android/assist/common/
DUtils.java218 StringBuffer buf = new StringBuffer("Bundle is: "); in toBundleString() local
221 buf.append("testcase type = " + testType); in toBundleString()
226 buf.append(s + "\n\t\t"); in toBundleString()
229 return buf.toString(); in toBundleString()

123