Home
last modified time | relevance | path

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

1234

/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/location/src/android/location/cts/asn1/base/
DAsn1Object.java92 ByteBuffer buf = ByteBuffer.allocate(getBerLength()); in encodeBer() local
93 encodeBer(buf); in encodeBer()
94 return buf.array(); in encodeBer()
97 void encodeBer(ByteBuffer buf) { in encodeBer() argument
105 tag.writeTagAndLength(buf, true, innerValueLen); in encodeBer()
109 tag.writeTagAndLength(buf, isConstructed(), valueLen); in encodeBer()
110 encodeBerValue(buf); in encodeBer()
120 abstract void encodeBerValue(ByteBuffer buf); in encodeBerValue() argument
133 void decodeBer(ByteBuffer buf) { in decodeBer() argument
134 Asn1Tag tag = Asn1Tag.readTag(buf); in decodeBer()
[all …]
DAsn1Choice.java44 public void writeTagAndLength(ByteBuffer buf, boolean constructed, int valueLength) {
134 public void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
145 select.getTag().writeTagAndLength(buf, value.isConstructed(), value.getBerValueLength()); in encodeBerValue()
146 value.encodeBerValue(buf); in encodeBerValue()
148 select.getTag().writeTagAndLength(buf, true, value.getBerLength()); in encodeBerValue()
149 value.encodeBer(buf); in encodeBerValue()
152 value.encodeBer(buf); in encodeBerValue()
157 public void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
158 Asn1Tag tag = Asn1Tag.peekTag(buf); in decodeBerValue()
165 Asn1Tag.readTag(buf); // Read the tag off. in decodeBerValue()
[all …]
DAsn1Tag.java97 public void writeTagAndLength(ByteBuffer buf, boolean constructed, int valueLength) { in writeTagAndLength() argument
98 this.writeTag(buf, constructed); in writeTagAndLength()
99 writeLength(buf, valueLength); in writeTagAndLength()
102 private void writeTag(ByteBuffer buf, boolean constructed) { in writeTag() argument
107 buf.put((byte) (getValue() | CONSTRUCTED_BIT)); in writeTag()
109 buf.put((byte) getValue()); in writeTag()
113 static Asn1Tag readTag(ByteBuffer buf) { in readTag() argument
114 return Asn1Tag.fromValue(buf.get() & 0xFF); in readTag()
120 static Asn1Tag peekTag(ByteBuffer buf) { in peekTag() argument
121 return Asn1Tag.fromValue(buf.get(buf.position()) & 0xFF); in peekTag()
[all …]
DAsn1Boolean.java46 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
47 buf.put(value ? (byte) 0xFF : (byte) 0x00); in encodeBerValue()
50 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
51 if (buf.remaining() != 1) { in decodeBerValue()
52 throw new IllegalArgumentException("Invalid remaining bytes: " + buf.remaining()); in decodeBerValue()
54 value = (buf.get() != 0); in decodeBerValue()
DAsn1SequenceOf.java76 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
78 component.encodeBer(buf); in encodeBerValue()
82 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
83 while (buf.hasRemaining()) { in decodeBerValue()
84 Asn1Tag tag = Asn1Tag.readTag(buf); in decodeBerValue()
85 int valueLength = Asn1Tag.readLength(buf); in decodeBerValue()
91 checkTag(value.getDefaultTag(), Asn1Tag.readTag(buf)); in decodeBerValue()
92 valueLength = Asn1Tag.readLength(buf); in decodeBerValue()
97 ByteBuffer subBuf = ByteBuffer.wrap(buf.array(), buf.position(), valueLength); in decodeBerValue()
102 buf.position(buf.position() + valueLength); in decodeBerValue()
DAsn1Sequence.java73 public void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
79 obj.encodeBer(buf); in encodeBerValue()
82 componentTag.writeTagAndLength(buf, obj.isConstructed(), obj.getBerValueLength()); in encodeBerValue()
83 obj.encodeBerValue(buf); in encodeBerValue()
85 componentTag.writeTagAndLength(buf, true, obj.getBerLength()); in encodeBerValue()
86 obj.encodeBer(buf); in encodeBerValue()
98 public void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
101 while (buf.hasRemaining()) { in decodeBerValue()
102 int bufStartPos = buf.position(); in decodeBerValue()
103 int bufEndPos = buf.limit(); in decodeBerValue()
[all …]
DAsn1Null.java44 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
47 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
48 if (buf.remaining() != 0) { in decodeBerValue()
49 throw new IllegalArgumentException("Invalid remaining bytes: " + buf.remaining()); in decodeBerValue()
DAsn1Utf8String.java74 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
76 buf.put(getValueBytes()); in encodeBerValue()
79 @Override public void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
80 setValueBytes(getRemaining(buf)); in decodeBerValue()
DAsn1BitString.java73 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
85 buf.put((byte) ((8 - (value.length() % 8)) % 8)); in encodeBerValue()
86 buf.put(bitStream.getPaddedBytes()); in encodeBerValue()
89 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
90 int unusedBits = buf.get() & 0xFF; in decodeBerValue()
91 byte[] valueBytes = getRemaining(buf); in decodeBerValue()
/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 …]
/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/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()
91 uint8_t *buf; in android_security_cts_EncryptionTest_aesIsFast() local
106 buf = new (std::nothrow) uint8_t[TEST_BUFSIZE + in android_security_cts_EncryptionTest_aesIsFast()
109 if (!buf) { in android_security_cts_EncryptionTest_aesIsFast()
115 memset(buf, 0xF0, TEST_BUFSIZE); in android_security_cts_EncryptionTest_aesIsFast()
121 EVP_DecryptUpdate(&ctx, buf, &len, buf, TEST_BUFSIZE); in android_security_cts_EncryptionTest_aesIsFast()
126 delete[] buf; in android_security_cts_EncryptionTest_aesIsFast()
/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]);
/cts/apps/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/common/device-side/util/src/com/android/compatibility/common/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()
/cts/tests/tests/alarmclock/common/src/android/alarmclock/common/
DUtils.java44 StringBuilder buf = new StringBuilder(); in toBundleString() local
46 buf.append("extras: "); in toBundleString()
48 buf.append("(" + s + " = " + bundle.get(s) + "), "); in toBundleString()
51 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/net/src/android/net/cts/
DSysctlBaseTest.java55 byte[] buf = new byte[1024]; in readFile()
57 int bytesRead = Os.read(fd, buf, 0, buf.length); in readFile()
58 assertLess("length of " + fileName + ":", bytesRead, buf.length); in readFile()
59 return new String(buf); in readFile()
/cts/hostsidetests/security/securityPatch/CVE-2017-0426/
Dpoc.c33 struct stat buf; in main() local
36 int fd = lstat("/bugreports", &buf); in main()
/cts/tests/tests/renderscript/src/android/renderscript/cts/
Dlarge_global.rs18 char buf[2*1024*1024];
22 buf[0] = c;
/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/hostsidetests/appsecurity/test-apps/StorageApp/src/com/android/cts/storageapp/
DUtils.java105 final byte[] buf = new byte[1024]; in useWrite()
107 os.write(buf, 0, (int) Math.min(buf.length, size)); in useWrite()
108 size -= buf.length; in useWrite()
175 final ByteArrayOutputStream buf = new ByteArrayOutputStream(); in logCommand() local
176 copy(proc.getInputStream(), buf); in logCommand() local
180 Log.d(TAG, buf.toString()); in logCommand()

1234