Home
last modified time | relevance | path

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

/frameworks/base/core/java/android/net/netlink/
DStructNlAttr.java43 public static StructNlAttr peek(ByteBuffer byteBuffer) { in peek() argument
44 if (byteBuffer == null || byteBuffer.remaining() < NLA_HEADERLEN) { in peek()
47 final int baseOffset = byteBuffer.position(); in peek()
50 struct.nla_len = byteBuffer.getShort(); in peek()
51 struct.nla_type = byteBuffer.getShort(); in peek()
52 struct.mByteOrder = byteBuffer.order(); in peek()
54 byteBuffer.position(baseOffset); in peek()
62 public static StructNlAttr parse(ByteBuffer byteBuffer) { in parse() argument
63 final StructNlAttr struct = peek(byteBuffer); in parse()
64 if (struct == null || byteBuffer.remaining() < struct.getAlignedLength()) { in parse()
[all …]
DRtNetlinkNeighborMessage.java57 private static StructNlAttr findNextAttrOfType(short attrType, ByteBuffer byteBuffer) { in findNextAttrOfType() argument
58 while (byteBuffer != null && byteBuffer.remaining() > 0) { in findNextAttrOfType()
59 final StructNlAttr nlAttr = StructNlAttr.peek(byteBuffer); in findNextAttrOfType()
64 return StructNlAttr.parse(byteBuffer); in findNextAttrOfType()
66 if (byteBuffer.remaining() < nlAttr.getAlignedLength()) { in findNextAttrOfType()
69 byteBuffer.position(byteBuffer.position() + nlAttr.getAlignedLength()); in findNextAttrOfType()
74 public static RtNetlinkNeighborMessage parse(StructNlMsgHdr header, ByteBuffer byteBuffer) { in parse() argument
77 neighMsg.mNdmsg = StructNdMsg.parse(byteBuffer); in parse()
83 final int baseOffset = byteBuffer.position(); in parse()
84 StructNlAttr nlAttr = findNextAttrOfType(NDA_DST, byteBuffer); in parse()
[all …]
DStructNdMsg.java97 private static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
98 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
101 public static StructNdMsg parse(ByteBuffer byteBuffer) { in parse() argument
102 if (!hasAvailableSpace(byteBuffer)) { return null; } in parse()
108 struct.ndm_family = byteBuffer.get(); in parse()
109 final byte pad1 = byteBuffer.get(); in parse()
110 final short pad2 = byteBuffer.getShort(); in parse()
111 struct.ndm_ifindex = byteBuffer.getInt(); in parse()
112 struct.ndm_state = byteBuffer.getShort(); in parse()
113 struct.ndm_flags = byteBuffer.get(); in parse()
[all …]
DStructNlMsgHdr.java77 public static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
78 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
81 public static StructNlMsgHdr parse(ByteBuffer byteBuffer) { in parse() argument
82 if (!hasAvailableSpace(byteBuffer)) { return null; } in parse()
88 struct.nlmsg_len = byteBuffer.getInt(); in parse()
89 struct.nlmsg_type = byteBuffer.getShort(); in parse()
90 struct.nlmsg_flags = byteBuffer.getShort(); in parse()
91 struct.nlmsg_seq = byteBuffer.getInt(); in parse()
92 struct.nlmsg_pid = byteBuffer.getInt(); in parse()
115 public void pack(ByteBuffer byteBuffer) { in pack() argument
[all …]
DNetlinkMessage.java45 public static NetlinkMessage parse(ByteBuffer byteBuffer) { in parse() argument
46 final int startPosition = (byteBuffer != null) ? byteBuffer.position() : -1; in parse()
47 final StructNlMsgHdr nlmsghdr = StructNlMsgHdr.parse(byteBuffer); in parse()
54 if (payloadLength < 0 || payloadLength > byteBuffer.remaining()) { in parse()
56 byteBuffer.position(byteBuffer.limit()); in parse()
63 return (NetlinkMessage) NetlinkErrorMessage.parse(nlmsghdr, byteBuffer); in parse()
65 byteBuffer.position(byteBuffer.position() + payloadLength); in parse()
71 return (NetlinkMessage) RtNetlinkNeighborMessage.parse(nlmsghdr, byteBuffer); in parse()
76 byteBuffer.position(byteBuffer.position() + payloadLength); in parse()
DStructNlMsgErr.java36 public static boolean hasAvailableSpace(ByteBuffer byteBuffer) { in hasAvailableSpace() argument
37 return byteBuffer != null && byteBuffer.remaining() >= STRUCT_SIZE; in hasAvailableSpace()
40 public static StructNlMsgErr parse(ByteBuffer byteBuffer) { in parse() argument
41 if (!hasAvailableSpace(byteBuffer)) { return null; } in parse()
47 struct.error = byteBuffer.getInt(); in parse()
48 struct.msg = StructNlMsgHdr.parse(byteBuffer); in parse()
55 public void pack(ByteBuffer byteBuffer) { in pack() argument
59 byteBuffer.putInt(error); in pack()
61 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()
DNetlinkSocket.java122 ByteBuffer byteBuffer = ByteBuffer.allocate(bufsize); in recvMessage() local
123 int length = Os.read(mDescriptor, byteBuffer); in recvMessage()
127 byteBuffer.position(0); in recvMessage()
128 byteBuffer.limit(length); in recvMessage()
129 byteBuffer.order(ByteOrder.nativeOrder()); in recvMessage()
130 return byteBuffer; in recvMessage()
DNetlinkErrorMessage.java32 public static NetlinkErrorMessage parse(StructNlMsgHdr header, ByteBuffer byteBuffer) { in parse() argument
35 errorMsg.mNlMsgErr = StructNlMsgErr.parse(byteBuffer); in parse()
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/
DByteArrayHelpers.java167 ByteBuffer byteBuffer = ByteBuffer.allocate(numbers.length * (Double.SIZE / Byte.SIZE)) in toByteArray() local
177 byteBuffer.putInt((Integer)value); in toByteArray()
179 byteBuffer.putFloat((Float)value); in toByteArray()
181 byteBuffer.putDouble((Double)value); in toByteArray()
183 byteBuffer.putShort((Short)value); in toByteArray()
185 byteBuffer.putLong((Long)value); in toByteArray()
187 byteBuffer.put((Byte)value); in toByteArray()
197 if (numbers.length != 0 && byteBuffer.position() < numbers.length) { in toByteArray()
200 numbers.length, byteBuffer.position())); in toByteArray()
203 byteBuffer.flip(); in toByteArray()
[all …]
/frameworks/base/core/tests/coretests/src/android/net/netlink/
DRtNetlinkNeighborMessageTest.java139 final ByteBuffer byteBuffer = ByteBuffer.wrap(RTM_DELNEIGH); in testParseRtmDelNeigh() local
140 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmDelNeigh()
141 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer); in testParseRtmDelNeigh()
165 final ByteBuffer byteBuffer = ByteBuffer.wrap(RTM_NEWNEIGH); in testParseRtmNewNeigh() local
166 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmNewNeigh()
167 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer); in testParseRtmNewNeigh()
191 final ByteBuffer byteBuffer = ByteBuffer.wrap(RTM_GETNEIGH_RESPONSE); in testParseRtmGetNeighResponse() local
192 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseRtmGetNeighResponse()
195 while (byteBuffer.remaining() > 0) { in testParseRtmGetNeighResponse()
196 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer); in testParseRtmGetNeighResponse()
DNetlinkErrorMessageTest.java57 final ByteBuffer byteBuffer = ByteBuffer.wrap(NLM_ERROR_OK); in testParseNlmErrorOk() local
58 byteBuffer.order(ByteOrder.LITTLE_ENDIAN); // For testing. in testParseNlmErrorOk()
59 final NetlinkMessage msg = NetlinkMessage.parse(byteBuffer); in testParseNlmErrorOk()
/frameworks/base/core/java/android/net/
DIpReachabilityMonitor.java320 ByteBuffer byteBuffer; in run() local
323 byteBuffer = recvKernelReply(); in run()
329 if (byteBuffer == null) { in run()
332 parseNetlinkMessageBuffer(byteBuffer, whenMs); in run()
378 private void parseNetlinkMessageBuffer(ByteBuffer byteBuffer, long whenMs) { in parseNetlinkMessageBuffer() argument
379 while (byteBuffer.remaining() > 0) { in parseNetlinkMessageBuffer()
380 final int position = byteBuffer.position(); in parseNetlinkMessageBuffer()
381 final NetlinkMessage nlMsg = NetlinkMessage.parse(byteBuffer); in parseNetlinkMessageBuffer()
383 byteBuffer.position(position); in parseNetlinkMessageBuffer()
384 Log.e(TAG, "unparsable netlink msg: " + NetlinkConstants.hexify(byteBuffer)); in parseNetlinkMessageBuffer()
/frameworks/base/packages/services/Proxy/src/com/android/proxyhandler/
DProxyServer.java228 int byteBuffer = inputStream.read(); in getLine() local
229 if (byteBuffer < 0) return ""; in getLine()
231 if (byteBuffer != '\r') { in getLine()
232 buffer.append((char)byteBuffer); in getLine()
234 byteBuffer = inputStream.read(); in getLine()
235 } while ((byteBuffer != '\n') && (byteBuffer >= 0)); in getLine()
/frameworks/base/media/mca/filterpacks/java/android/filterpacks/base/
DInputStreamSource.java64 ByteBuffer byteBuffer = null; in process() local
75 byteBuffer = ByteBuffer.wrap(byteStream.toByteArray()); in process()
84 output.setData(byteBuffer); in process()
/frameworks/base/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/
DColorfulnessFilter.java58 ByteBuffer byteBuffer = histogramFrame.lockBytes(Frame.MODE_READ); in onProcess() local
59 byteBuffer.order(ByteOrder.nativeOrder()); in onProcess()
60 FloatBuffer histogramBuffer = byteBuffer.asFloatBuffer(); in onProcess()
/frameworks/base/core/jni/
Dandroid_net_LocalSocketImpl.cpp668 jbyte* byteBuffer; in socket_readba() local
692 byteBuffer = env->GetByteArrayElements(buffer, NULL); in socket_readba()
694 if (NULL == byteBuffer) { in socket_readba()
700 fd, byteBuffer + off, len); in socket_readba()
704 env->ReleaseByteArrayElements(buffer, byteBuffer, 0); in socket_readba()
736 jbyte* byteBuffer; in socket_writeba() local
754 byteBuffer = env->GetByteArrayElements(buffer,NULL); in socket_writeba()
756 if (NULL == byteBuffer) { in socket_writeba()
762 byteBuffer + off, len); in socket_writeba()
766 env->ReleaseByteArrayElements(buffer, byteBuffer, JNI_ABORT); in socket_writeba()
/frameworks/base/packages/WallpaperCropper/src/com/android/gallery3d/exif/
DExifModifier.java47 protected ExifModifier(ByteBuffer byteBuffer, ExifInterface iRef) throws IOException, in ExifModifier() argument
49 mByteBuffer = byteBuffer; in ExifModifier()
50 mOffsetBase = byteBuffer.position(); in ExifModifier()
54 is = new ByteBufferInputStream(byteBuffer); in ExifModifier()
/frameworks/base/media/jni/
Dandroid_media_MediaCodec.cpp418 jobject byteBuffer = NULL; in getBuffers() local
420 env, !input /* readOnly */, true /* clearBuffer */, buffer, &byteBuffer); in getBuffers()
424 if (byteBuffer != NULL) { in getBuffers()
426 *bufArray, i, byteBuffer); in getBuffers()
428 env->DeleteLocalRef(byteBuffer); in getBuffers()
429 byteBuffer = NULL; in getBuffers()
447 jobject byteBuffer = in createByteBufferFromABuffer() local
449 if (readOnly && byteBuffer != NULL) { in createByteBufferFromABuffer()
451 byteBuffer, mByteBufferAsReadOnlyBufferMethodID); in createByteBufferFromABuffer()
452 env->DeleteLocalRef(byteBuffer); in createByteBufferFromABuffer()
[all …]
Dandroid_media_ImageWriter.cpp1002 jobject byteBuffer; in Image_createSurfacePlanes() local
1033 byteBuffer = env->NewDirectByteBuffer(pData, dataSize); in Image_createSurfacePlanes()
1034 if ((byteBuffer == NULL) && (env->ExceptionCheck() == false)) { in Image_createSurfacePlanes()
1042 gSurfacePlaneClassInfo.ctor, thiz, rowStride, pixelStride, byteBuffer); in Image_createSurfacePlanes()
Dandroid_media_ImageReader.cpp1176 jobject byteBuffer; in Image_getByteBuffer() local
1205 byteBuffer = env->NewDirectByteBuffer(base, size); in Image_getByteBuffer()
1207 if ((byteBuffer == NULL) && (env->ExceptionCheck() == false)) { in Image_getByteBuffer()
1211 return byteBuffer; in Image_getByteBuffer()
/frameworks/base/media/java/android/media/
DMediaSync.java177 public AudioBuffer(@NonNull ByteBuffer byteBuffer, int bufferId, in AudioBuffer() argument
179 mByteBuffer = byteBuffer; in AudioBuffer()
/frameworks/opt/vcard/java/com/android/vcard/
DVCardUtils.java838 final ByteBuffer byteBuffer = charset.encode(originalString); in convertStringCharset() local
841 final byte[] bytes = new byte[byteBuffer.remaining()]; in convertStringCharset()
842 byteBuffer.get(bytes); in convertStringCharset()
/frameworks/base/opengl/java/android/opengl/
DGLLogWrapper.java1030 ByteBuffer byteBuffer = toByteBuffer(count, indices); in toCharIndices() local
1031 byte[] array = byteBuffer.array(); in toCharIndices()
1032 int offset = byteBuffer.arrayOffset(); in toCharIndices()
1043 ByteBuffer byteBuffer = toByteBuffer(count * 2, indices); in toCharIndices() local
1044 charBuffer = byteBuffer.asCharBuffer(); in toCharIndices()
1077 ByteBuffer byteBuffer = pointer.mTempByteBuffer; in doArrayElement() local
1088 byte d = byteBuffer.get(byteOffset); in doArrayElement()
1093 byte d = byteBuffer.get(byteOffset); in doArrayElement()
1098 ShortBuffer shortBuffer = byteBuffer.asShortBuffer(); in doArrayElement()
1104 IntBuffer intBuffer = byteBuffer.asIntBuffer(); in doArrayElement()
[all …]