tag | f44a760d2a219fc9af08690b2c2f8e9072e9f402 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Tue May 07 10:56:53 2024 -0700 |
object | 6ca496e6eb21fa2f96d657c1ccd204ccf2f578dc |
Android 14.0.0 release 35
commit | 6ca496e6eb21fa2f96d657c1ccd204ccf2f578dc | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Sat Oct 07 23:06:21 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Sat Oct 07 23:06:21 2023 +0000 |
tree | 77ec2740277e4361522175b4f04e0a1d118c0e74 | |
parent | d300d57d5b1b1bf4cdd901db9aede78ee0a8bf69 [diff] | |
parent | 3bcaeafe943411543f051b8142b62ffe45589356 [diff] |
Snap for 10917888 from 3bcaeafe943411543f051b8142b62ffe45589356 to 24Q1-release Change-Id: I6db1e24a939b093a412ff82fdda2702487a5333d
A Java 7 implementation of RFC 7049: Concise Binary Object Representation (CBOR)
Add this to the dependencies section of your pom.xml file:
<dependency> <groupId>co.nstant.in</groupId> <artifactId>cbor</artifactId> <version>0.8</version> </dependency>
ByteArrayOutputStream baos = new ByteArrayOutputStream(); new CborEncoder(baos).encode(new CborBuilder() .add("text") // add string .add(1234) // add integer .add(new byte[] { 0x10 }) // add byte array .addArray() // add array .add(1) .add("text") .end() .build()); byte[] encodedBytes = baos.toByteArray();
ByteArrayInputStream bais = new ByteArrayInputStream(encodedBytes); List<DataItem> dataItems = new CborDecoder(bais).decode(); for(DataItem dataItem : dataItems) { // process data item }
ByteArrayInputStream bais = new ByteArrayInputStream(encodedBytes); new CborDecoder(bais).decode(new DataItemListener() { @Override public void onDataItem(DataItem dataItem) { // process data item } });
This project uses the C4 process for all code changes.
Copyright 2013-2017 Constantin Rack Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.