Home
last modified time | relevance | path

Searched refs:byteBuffer (Results 1 – 25 of 75) sorted by relevance

123

/packages/modules/IPsec/src/java/com/android/internal/net/eap/message/simaka/
DEapSimAkaAttribute.java133 public abstract void encode(ByteBuffer byteBuffer); in encode() argument
135 protected void encodeAttributeHeader(ByteBuffer byteBuffer) { in encodeAttributeHeader() argument
136 byteBuffer.put((byte) attributeType); in encodeAttributeHeader()
137 byteBuffer.put((byte) (lengthInBytes / LENGTH_SCALING)); in encodeAttributeHeader()
140 void consumePadding(int bytesUsed, ByteBuffer byteBuffer) { in consumePadding() argument
142 byteBuffer.get(new byte[paddingRemaining]); in consumePadding()
145 void addPadding(int bytesUsed, ByteBuffer byteBuffer) { in addPadding() argument
147 byteBuffer.put(new byte[paddingNeeded]); in addPadding()
162 ByteBuffer byteBuffer) throws EapSimAkaInvalidAttributeException { in EapSimAkaUnsupportedAttribute() argument
168 byteBuffer.get(data); in EapSimAkaUnsupportedAttribute()
[all …]
DEapSimAkaAttributeFactory.java77 EapSimAkaAttribute getAttribute(int attributeType, int lengthInBytes, ByteBuffer byteBuffer) in getAttribute() argument
82 return new AtPermanentIdReq(lengthInBytes, byteBuffer); in getAttribute()
84 return new AtAnyIdReq(lengthInBytes, byteBuffer); in getAttribute()
86 return new AtFullauthIdReq(lengthInBytes, byteBuffer); in getAttribute()
88 return new AtIdentity(lengthInBytes, byteBuffer); in getAttribute()
90 return new AtPadding(lengthInBytes, byteBuffer); in getAttribute()
92 return new AtMac(lengthInBytes, byteBuffer); in getAttribute()
94 return new AtCounter(lengthInBytes, byteBuffer); in getAttribute()
96 return new AtCounterTooSmall(lengthInBytes, byteBuffer); in getAttribute()
98 return new AtNonceS(lengthInBytes, byteBuffer); in getAttribute()
[all …]
DEapAkaAttributeFactory.java66 public EapSimAkaAttribute getAttribute(ByteBuffer byteBuffer) in getAttribute() argument
68 int attributeType = Byte.toUnsignedInt(byteBuffer.get()); in getAttribute()
71 int lengthInBytes = Byte.toUnsignedInt(byteBuffer.get()) * LENGTH_SCALING; in getAttribute()
73 return getAttribute(attributeType, lengthInBytes, byteBuffer); in getAttribute()
78 int attributeType, int lengthInBytes, ByteBuffer byteBuffer) in getAttribute() argument
82 return new AtRandAka(lengthInBytes, byteBuffer); in getAttribute()
84 return new AtAutn(lengthInBytes, byteBuffer); in getAttribute()
86 return new AtRes(lengthInBytes, byteBuffer); in getAttribute()
88 return new AtAuts(lengthInBytes, byteBuffer); in getAttribute()
90 return new AtBidding(lengthInBytes, byteBuffer); in getAttribute()
[all …]
DEapSimAttributeFactory.java65 public EapSimAkaAttribute getAttribute(ByteBuffer byteBuffer) throws in getAttribute() argument
67 int attributeType = Byte.toUnsignedInt(byteBuffer.get()); in getAttribute()
70 int lengthInBytes = Byte.toUnsignedInt(byteBuffer.get()) * LENGTH_SCALING; in getAttribute()
75 return new AtVersionList(lengthInBytes, byteBuffer); in getAttribute()
77 int selectedVersion = Short.toUnsignedInt(byteBuffer.getShort()); in getAttribute()
80 return new AtNonceMt(lengthInBytes, byteBuffer); in getAttribute()
82 return new AtRandSim(lengthInBytes, byteBuffer); in getAttribute()
84 return super.getAttribute(attributeType, lengthInBytes, byteBuffer); in getAttribute()
DEapAkaPrimeAttributeFactory.java61 public EapSimAkaAttribute getAttribute(ByteBuffer byteBuffer) in getAttribute() argument
63 int attributeType = Byte.toUnsignedInt(byteBuffer.get()); in getAttribute()
66 int lengthInBytes = Byte.toUnsignedInt(byteBuffer.get()) * LENGTH_SCALING; in getAttribute()
70 return new AtKdfInput(lengthInBytes, byteBuffer); in getAttribute()
72 return new AtKdf(lengthInBytes, byteBuffer); in getAttribute()
74 return super.getAttribute(attributeType, lengthInBytes, byteBuffer); in getAttribute()
/packages/modules/NetworkStack/common/netlinkclient/src/android/net/netlink/
DStructNlAttr.java45 public static StructNlAttr peek(ByteBuffer byteBuffer) { in peek() argument
46 if (byteBuffer == null || byteBuffer.remaining() < NLA_HEADERLEN) { in peek()
49 final int baseOffset = byteBuffer.position(); in peek()
52 final StructNlAttr struct = new StructNlAttr(byteBuffer.order()); in peek()
54 final ByteOrder originalOrder = byteBuffer.order(); in peek()
55 byteBuffer.order(ByteOrder.nativeOrder()); in peek()
57 struct.nla_len = byteBuffer.getShort(); in peek()
58 struct.nla_type = byteBuffer.getShort(); in peek()
60 byteBuffer.order(originalOrder); in peek()
63 byteBuffer.position(baseOffset); in peek()
[all …]
DRtNetlinkNeighborMessage.java51 private static StructNlAttr findNextAttrOfType(short attrType, ByteBuffer byteBuffer) { in findNextAttrOfType() argument
52 while (byteBuffer != null && byteBuffer.remaining() > 0) { in findNextAttrOfType()
53 final StructNlAttr nlAttr = StructNlAttr.peek(byteBuffer); in findNextAttrOfType()
58 return StructNlAttr.parse(byteBuffer); in findNextAttrOfType()
60 if (byteBuffer.remaining() < nlAttr.getAlignedLength()) { in findNextAttrOfType()
63 byteBuffer.position(byteBuffer.position() + nlAttr.getAlignedLength()); in findNextAttrOfType()
68 public static RtNetlinkNeighborMessage parse(StructNlMsgHdr header, ByteBuffer byteBuffer) { in parse() argument
71 neighMsg.mNdmsg = StructNdMsg.parse(byteBuffer); in parse()
77 final int baseOffset = byteBuffer.position(); in parse()
78 StructNlAttr nlAttr = findNextAttrOfType(NDA_DST, byteBuffer); in parse()
[all …]
DStructNdMsg.java101 private static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
102 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
105 public static StructNdMsg parse(ByteBuffer byteBuffer) { in parse() argument
106 if (!hasAvailableSpace(byteBuffer)) { return null; } in parse()
112 struct.ndm_family = byteBuffer.get(); in parse()
113 final byte pad1 = byteBuffer.get(); in parse()
114 final short pad2 = byteBuffer.getShort(); in parse()
115 struct.ndm_ifindex = byteBuffer.getInt(); in parse()
116 struct.ndm_state = byteBuffer.getShort(); in parse()
117 struct.ndm_flags = byteBuffer.get(); in parse()
[all …]
DStructNlMsgHdr.java76 public static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
77 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
80 public static StructNlMsgHdr parse(ByteBuffer byteBuffer) { in parse() argument
81 if (!hasAvailableSpace(byteBuffer)) { return null; } in parse()
87 struct.nlmsg_len = byteBuffer.getInt(); in parse()
88 struct.nlmsg_type = byteBuffer.getShort(); in parse()
89 struct.nlmsg_flags = byteBuffer.getShort(); in parse()
90 struct.nlmsg_seq = byteBuffer.getInt(); in parse()
91 struct.nlmsg_pid = byteBuffer.getInt(); in parse()
114 public void pack(ByteBuffer byteBuffer) { in pack() argument
[all …]
DNetlinkMessage.java38 public static NetlinkMessage parse(ByteBuffer byteBuffer) { in parse() argument
39 final int startPosition = (byteBuffer != null) ? byteBuffer.position() : -1; in parse()
40 final StructNlMsgHdr nlmsghdr = StructNlMsgHdr.parse(byteBuffer); in parse()
47 if (payloadLength < 0 || payloadLength > byteBuffer.remaining()) { in parse()
49 byteBuffer.position(byteBuffer.limit()); in parse()
56 return (NetlinkMessage) NetlinkErrorMessage.parse(nlmsghdr, byteBuffer); in parse()
58 byteBuffer.position(byteBuffer.position() + payloadLength); in parse()
64 return (NetlinkMessage) RtNetlinkNeighborMessage.parse(nlmsghdr, byteBuffer); in parse()
66 return (NetlinkMessage) InetDiagMessage.parse(nlmsghdr, byteBuffer); in parse()
68 return (NetlinkMessage) NduseroptMessage.parse(nlmsghdr, byteBuffer); in parse()
[all …]
DStructInetDiagSockId.java58 public void pack(ByteBuffer byteBuffer) { in pack() argument
59 byteBuffer.order(BIG_ENDIAN); in pack()
60 byteBuffer.putShort((short) mLocSocketAddress.getPort()); in pack()
61 byteBuffer.putShort((short) mRemSocketAddress.getPort()); in pack()
62 byteBuffer.put(mLocSocketAddress.getAddress().getAddress()); in pack()
64 byteBuffer.put(IPV4_PADDING); in pack()
66 byteBuffer.put(mRemSocketAddress.getAddress().getAddress()); in pack()
68 byteBuffer.put(IPV4_PADDING); in pack()
70 byteBuffer.order(ByteOrder.nativeOrder()); in pack()
71 byteBuffer.putInt(0); in pack()
[all …]
DStructNlMsgErr.java32 public static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
33 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
36 public static StructNlMsgErr parse(ByteBuffer byteBuffer) { in parse() argument
37 if (!hasAvailableSpace(byteBuffer)) { return null; } in parse()
43 struct.error = byteBuffer.getInt(); in parse()
44 struct.msg = StructNlMsgHdr.parse(byteBuffer); in parse()
51 public void pack(ByteBuffer byteBuffer) { in pack() argument
55 byteBuffer.putInt(error); in pack()
57 msg.pack(byteBuffer); in pack()
DStructNdaCacheInfo.java36 private static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
37 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
40 public static StructNdaCacheInfo parse(ByteBuffer byteBuffer) { in parse() argument
41 if (!hasAvailableSpace(byteBuffer)) { return null; } in parse()
47 struct.ndm_used = byteBuffer.getInt(); in parse()
48 struct.ndm_confirmed = byteBuffer.getInt(); in parse()
49 struct.ndm_updated = byteBuffer.getInt(); in parse()
50 struct.ndm_refcnt = byteBuffer.getInt(); in parse()
DConntrackMessage.java82 final ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); in newIPv4TimeoutUpdateRequest() local
83 byteBuffer.order(ByteOrder.nativeOrder()); in newIPv4TimeoutUpdateRequest()
90 ctmsg.pack(byteBuffer); in newIPv4TimeoutUpdateRequest()
92 ctaTupleOrig.pack(byteBuffer); in newIPv4TimeoutUpdateRequest()
93 ctaTimeout.pack(byteBuffer); in newIPv4TimeoutUpdateRequest()
105 public void pack(ByteBuffer byteBuffer) { in pack() argument
106 mHeader.pack(byteBuffer); in pack()
107 mNfGenMsg.pack(byteBuffer); in pack()
DStructInetDiagReqV2.java73 public void pack(ByteBuffer byteBuffer) { in pack() argument
75 byteBuffer.put((byte) mSdiagFamily); in pack()
76 byteBuffer.put((byte) mSdiagProtocol); in pack()
77 byteBuffer.put((byte) mIdiagExt); in pack()
78 byteBuffer.put((byte) mPad); in pack()
79 byteBuffer.putInt(mState); in pack()
80 if (mId != null) mId.pack(byteBuffer); in pack()
DNetlinkSocket.java134 ByteBuffer byteBuffer = ByteBuffer.allocate(bufsize); in recvMessage() local
135 int length = Os.read(fd, byteBuffer); in recvMessage()
139 byteBuffer.position(0); in recvMessage()
140 byteBuffer.limit(length); in recvMessage()
141 byteBuffer.order(ByteOrder.nativeOrder()); in recvMessage()
142 return byteBuffer; in recvMessage()
/packages/apps/Gallery2/src/com/android/gallery3d/glrenderer/
DNinePatchChunk.java50 ByteBuffer byteBuffer = in deserialize() local
53 byte wasSerialized = byteBuffer.get(); in deserialize()
57 chunk.mDivX = new int[byteBuffer.get()]; in deserialize()
58 chunk.mDivY = new int[byteBuffer.get()]; in deserialize()
59 chunk.mColor = new int[byteBuffer.get()]; in deserialize()
65 byteBuffer.getInt(); in deserialize()
66 byteBuffer.getInt(); in deserialize()
68 chunk.mPaddings.left = byteBuffer.getInt(); in deserialize()
69 chunk.mPaddings.right = byteBuffer.getInt(); in deserialize()
70 chunk.mPaddings.top = byteBuffer.getInt(); in deserialize()
[all …]
/packages/modules/NetworkStack/tests/unit/src/android/net/netlink/
DRtNetlinkNeighborMessageTest.java82 final ByteBuffer byteBuffer = ByteBuffer.wrap(RTM_DELNEIGH); in testParseRtmDelNeigh() local
83 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmDelNeigh()
84 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer); in testParseRtmDelNeigh()
109 final ByteBuffer byteBuffer = ByteBuffer.wrap(RTM_NEWNEIGH); in testParseRtmNewNeigh() local
110 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmNewNeigh()
111 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer); in testParseRtmNewNeigh()
136 final ByteBuffer byteBuffer = ByteBuffer.wrap(RTM_GETNEIGH_RESPONSE); in testParseRtmGetNeighResponse() local
137 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmGetNeighResponse()
140 while (byteBuffer.remaining() > 0) { in testParseRtmGetNeighResponse()
141 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer); in testParseRtmGetNeighResponse()
/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/message/
DIkeSaPayload.java700 protected void encodeToByteBuffer(boolean isLast, ByteBuffer byteBuffer) { in encodeToByteBuffer() argument
704 byteBuffer in encodeToByteBuffer()
718 byteBuffer.putInt((int) spi); in encodeToByteBuffer()
721 byteBuffer.putLong((long) spi); in encodeToByteBuffer()
731 allTransforms[i].encodeToByteBuffer(i == allTransforms.length - 1, byteBuffer); in encodeToByteBuffer()
1090 protected abstract void encodeToByteBuffer(boolean isLast, ByteBuffer byteBuffer); in encodeToByteBuffer() argument
1095 protected void encodeBasicTransformToByteBuffer(boolean isLast, ByteBuffer byteBuffer) { in encodeBasicTransformToByteBuffer() argument
1097 byteBuffer in encodeBasicTransformToByteBuffer()
1273 protected void encodeToByteBuffer(boolean isLast, ByteBuffer byteBuffer) { in encodeToByteBuffer() argument
1274 encodeBasicTransformToByteBuffer(isLast, byteBuffer); in encodeToByteBuffer()
[all …]
DIkeIdPayload.java120 ByteBuffer byteBuffer = ByteBuffer.allocate(getPayloadLength() - GENERIC_HEADER_LENGTH); in getEncodedPayloadBody() local
122 byteBuffer in getEncodedPayloadBody()
126 return byteBuffer.array(); in getEncodedPayloadBody()
142 protected void encodeToByteBuffer(@PayloadType int nextPayload, ByteBuffer byteBuffer) { in encodeToByteBuffer() argument
143 encodePayloadHeaderToByteBuffer(nextPayload, getPayloadLength(), byteBuffer); in encodeToByteBuffer()
144 byteBuffer.put(getEncodedPayloadBody()); in encodeToByteBuffer()
DIkeAuthPayload.java115 protected void encodeToByteBuffer(@PayloadType int nextPayload, ByteBuffer byteBuffer) { in encodeToByteBuffer() argument
116 encodePayloadHeaderToByteBuffer(nextPayload, getPayloadLength(), byteBuffer); in encodeToByteBuffer()
117 byteBuffer.put((byte) authMethod).put(new byte[AUTH_RESERVED_FIELD_LEN]); in encodeToByteBuffer()
118 encodeAuthDataToByteBuffer(byteBuffer); in encodeToByteBuffer()
126 protected abstract void encodeAuthDataToByteBuffer(ByteBuffer byteBuffer); in encodeAuthDataToByteBuffer() argument
/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/ipsec/ike/message/
DIkeSaPayloadTest.java279 ByteBuffer byteBuffer = ByteBuffer.allocate(mAttributeKeyLength128.getAttributeLength()); in testEncodeAttribute() local
280 mAttributeKeyLength128.encodeToByteBuffer(byteBuffer); in testEncodeAttribute()
284 assertArrayEquals(expectedBytes, byteBuffer.array()); in testEncodeAttribute()
323 ByteBuffer byteBuffer = ByteBuffer.allocate(mEncrAesCbc128Transform.getTransformLength()); in testEncodeEncryptionTransform() local
324 mEncrAesCbc128Transform.encodeToByteBuffer(false, byteBuffer); in testEncodeEncryptionTransform()
328 assertArrayEquals(expectedBytes, byteBuffer.array()); in testEncodeEncryptionTransform()
367 ByteBuffer byteBuffer = ByteBuffer.allocate(mPrfHmacSha1Transform.getTransformLength()); in testEncodePrfTransform() local
368 mPrfHmacSha1Transform.encodeToByteBuffer(true, byteBuffer); in testEncodePrfTransform()
372 assertArrayEquals(expectedBytes, byteBuffer.array()); in testEncodePrfTransform()
418 ByteBuffer byteBuffer = ByteBuffer.allocate(mIntegHmacSha1Transform.getTransformLength()); in testEncodeIntegrityTransform() local
[all …]
/packages/apps/Dialer/java/com/android/dialer/callcomposer/camera/exif/
DCountedDataInputStream.java34 private final ByteBuffer byteBuffer = ByteBuffer.wrap(byteArray); field in CountedDataInputStream
97 byteBuffer.order(order); in setByteOrder()
101 return byteBuffer.order(); in getByteOrder()
106 byteBuffer.rewind(); in readShort()
107 return byteBuffer.getShort(); in readShort()
116 byteBuffer.rewind(); in readInt()
117 return byteBuffer.getInt(); in readInt()
/packages/modules/NetworkStack/common/moduleutils/src/android/net/ip/
DNetlinkMonitor.java105 final ByteBuffer byteBuffer = ByteBuffer.wrap(recvbuf, 0, length); in handlePacket() local
106 byteBuffer.order(ByteOrder.nativeOrder()); in handlePacket()
108 while (byteBuffer.remaining() > 0) { in handlePacket()
110 final int position = byteBuffer.position(); in handlePacket()
111 final NetlinkMessage nlMsg = NetlinkMessage.parse(byteBuffer); in handlePacket()
113 byteBuffer.position(position); in handlePacket()
114 mLog.e("unparsable netlink msg: " + hexify(byteBuffer)); in handlePacket()
/packages/apps/Camera2/src/com/android/camera/processing/memory/
DByteBufferDirectPool.java36 protected ByteBuffer recycle(Integer integer, ByteBuffer byteBuffer) { in recycle() argument
38 byteBuffer.rewind(); in recycle()
39 byteBuffer.limit(byteBuffer.capacity()); in recycle()
40 return byteBuffer; in recycle()

123