commit | 179f1daf98c96301c5d78b68d11695ce61c6cd16 | [log] [tgz] |
---|---|---|
author | Jorge Saldivar <jorgesaldivar@google.com> | Thu Jul 21 19:09:14 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Jul 21 19:09:14 2022 +0000 |
tree | 56f31157953f23fba647e4379f76cb97469bf935 | |
parent | 25446536428d4490de4e0a23c5fd68afcf027452 [diff] | |
parent | 07d7a4fce628e38253ffb27ac8e7d20a28ddc266 [diff] |
Updated minSdkVersion to 30 to external/cbor-java am: 07d7a4fce6 Original change: https://android-review.googlesource.com/c/platform/external/cbor-java/+/2161183 Change-Id: Ibed099a028e7e8f39310cfca320380dd55d6be29 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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.