tag | 41f91e03b28c3436e4ca19b887e387262cdd33a7 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Thu Feb 02 02:55:49 2023 -0800 |
object | 21aa6d83d4af4d97e39863ea1ee09cd5cb866e62 |
aml_tz4_331314010 (9399028,com.google.android.tzdata4)
commit | 21aa6d83d4af4d97e39863ea1ee09cd5cb866e62 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Tue Aug 16 16:30:12 2022 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Tue Aug 16 16:30:12 2022 +0000 |
tree | 25cfedb79267c6e86c5292b2644a89af3d7f163a | |
parent | 6b4b6adc5ff8f91e2ddef14adf510e14aaf90204 [diff] | |
parent | aa614ea53b920899c88e705ab5cc57f0083ec91a [diff] |
Snap for 8953554 from aa614ea53b920899c88e705ab5cc57f0083ec91a to mainline-tzdata4-release Change-Id: Ic335d8575ac25b1c21793bcd8e93d3d20db00e32
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.