From e667f2b6d86abf940087a9bd25a938405b2fb792 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Fri, 27 Jan 2017 14:14:20 +0100 Subject: [PATCH 1/4] Set theme jekyll-theme-hacker --- _config.yml | 1 + index.md | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 _config.yml create mode 100644 index.md diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..fc24e7a --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-hacker \ No newline at end of file diff --git a/index.md b/index.md new file mode 100644 index 0000000..1a2301b --- /dev/null +++ b/index.md @@ -0,0 +1,37 @@ +## Welcome to GitHub Pages + +You can use the [editor on GitHub](https://github.com/Dissem/MsgPack/edit/master/index.md) to maintain and preview the content for your website in Markdown files. + +Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files. + +### Markdown + +Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for + +```markdown +Syntax highlighted code block + +# Header 1 +## Header 2 +### Header 3 + +- Bulleted +- List + +1. Numbered +2. List + +**Bold** and _Italic_ and `Code` text + +[Link](url) and ![Image](src) +``` + +For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/). + +### Jekyll Themes + +Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/Dissem/MsgPack/settings). The name of this theme is saved in the Jekyll `_config.yml` configuration file. + +### Support or Contact + +Having trouble with Pages? Check out our [documentation](https://help.github.com/categories/github-pages-basics/) or [contact support](https://github.com/contact) and we’ll help you sort it out. From a14207f421149fbd83245b5a2c33c576b59c6870 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Fri, 27 Jan 2017 14:17:46 +0100 Subject: [PATCH 2/4] Update index.md --- index.md | 85 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 21 deletions(-) diff --git a/index.md b/index.md index 1a2301b..ea5719d 100644 --- a/index.md +++ b/index.md @@ -1,37 +1,80 @@ -## Welcome to GitHub Pages +## Simple msgpack library for Java -You can use the [editor on GitHub](https://github.com/Dissem/MsgPack/edit/master/index.md) to maintain and preview the content for your website in Markdown files. +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/ch.dissem.msgpack/msgpack/badge.svg)](https://maven-badges.herokuapp.com/maven-central/ch.dissem.msgpack/msgpack) +[![Javadoc](https://javadoc-emblem.rhcloud.com/doc/ch.dissem.msgpack/msgpack/badge.svg)](http://www.javadoc.io/doc/ch.dissem.msgpack/msgpack) +[![Apache 2](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](https://raw.githubusercontent.com/Dissem/Jabit/master/LICENSE) -Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files. +This is a simple Java library for handling MessagePack data. It doesn't do any object mapping, but maps to special +objects representing MessagePack types. To build, use command `./gradlew build`. -### Markdown +For most cases you might be better off using `org.msgpack:msgpack`, but I found that I needed something that generically +represents the internal structure of the data. -Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for +msgpack uses Semantic Versioning, meaning as long as the major version doesn't change, nothing should break if you +update. Be aware though that this doesn't necessarily applies for SNAPSHOT builds and the development branch. -```markdown -Syntax highlighted code block -# Header 1 -## Header 2 -### Header 3 +#### Master +[![Build Status](https://travis-ci.org/Dissem/MsgPack.svg?branch=master)](https://travis-ci.org/Dissem/MsgPack) +[![Code Quality](https://img.shields.io/codacy/eb92c25247b4444383b163304e57a3ce/master.svg)](https://www.codacy.com/app/chrigu-meyer/MsgPack/dashboard?bid=4122049) +[![Test Coverage](https://codecov.io/github/Dissem/MsgPack/coverage.svg?branch=master)](https://codecov.io/github/Dissem/MsgPack?branch=master) -- Bulleted -- List +#### Develop +[![Build Status](https://travis-ci.org/Dissem/MsgPack.svg?branch=develop)](https://travis-ci.org/Dissem/MsgPack?branch=develop) +[![Code Quality](https://img.shields.io/codacy/eb92c25247b4444383b163304e57a3ce/develop.svg)](https://www.codacy.com/app/chrigu-meyer/MsgPack/dashboard?bid=4118049) +[![Test Coverage](https://codecov.io/github/Dissem/MsgPack/coverage.svg?branch=develop)](https://codecov.io/github/Dissem/MsgPack?branch=develop) -1. Numbered -2. List +### Limitations -**Bold** and _Italic_ and `Code` text +* There is no fallback to BigInteger for large integer type numbers, so there might be an integer overflow when reading + too large numbers +* `MPFloat` uses the data type you're using to decide on precision (float 32 or 64) - not the actual value. E.g. 0.5 + could be saved perfectly as a float 42, but if you provide a double value, it will be stored as float 64, wasting + 4 bytes. -[Link](url) and ![Image](src) +### Setup + +Add msgpack as Gradle dependency: +```Gradle +compile "ch.dissem.msgpack:msgpack:1.0.0" ``` -For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/). +### Usage -### Jekyll Themes +#### Serialize Data -Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/Dissem/MsgPack/settings). The name of this theme is saved in the Jekyll `_config.yml` configuration file. +First, you'll need to create some msgpack objects to serialize: +```Java +MPMap> object = new MPMap<>(); +object.put(new MPString("compact"), new MPBoolean(true)); +object.put(new MPString("schema"), new MPInteger(0)); +``` +or the shorthand version for simple types: +```Java +import static ch.dissem.msgpack.types.Utils.mp; -### Support or Contact +MPMap> object = new MPMap<>(); +object.put(mp("compact"), mp(true)); +object.put(mp("schema"), mp(0)); +``` +then just use `pack(OutputStream)`: +```Java +OutputStream out = ...; +object.pack(out); +``` -Having trouble with Pages? Check out our [documentation](https://help.github.com/categories/github-pages-basics/) or [contact support](https://github.com/contact) and we’ll help you sort it out. + +#### Deserialize Data + +For deserializing data there is the reader object: +```Java +Reader reader = Reader.getInstance() +``` +just use `reader.read(InputStream)`. Unfortunately you'll need to make sure you got what you expected, the following +example might result in `ClassCastException` at weird places: +```Java +InputStream in = ...; +MPType read = reader.read(in); +MPMap map = (MPMap) read; +String value = map.get(mp("key")).getValue(); +``` From a87ab60c6867992357e70c8c08a6d02ee3cfd48f Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Sat, 11 Feb 2017 10:45:07 +0100 Subject: [PATCH 3/4] Added project description for maven central --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 509edc2..fd25849 100644 --- a/build.gradle +++ b/build.gradle @@ -55,6 +55,7 @@ uploadArchives { pom.project { name 'msgpack' + description 'A simple Java library for handling MessagePack data' packaging 'jar' url 'https://dissem.ch/msgpack' From 687836b2958820fd57aa3c79fe4ced11fb0f2332 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Sat, 11 Feb 2017 23:37:20 +0100 Subject: [PATCH 4/4] Removed files from messed up merge --- _config.yml | 1 - index.md | 80 ----------------------------------------------------- 2 files changed, 81 deletions(-) delete mode 100644 _config.yml delete mode 100644 index.md diff --git a/_config.yml b/_config.yml deleted file mode 100644 index fc24e7a..0000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-hacker \ No newline at end of file diff --git a/index.md b/index.md deleted file mode 100644 index ea5719d..0000000 --- a/index.md +++ /dev/null @@ -1,80 +0,0 @@ -## Simple msgpack library for Java - -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/ch.dissem.msgpack/msgpack/badge.svg)](https://maven-badges.herokuapp.com/maven-central/ch.dissem.msgpack/msgpack) -[![Javadoc](https://javadoc-emblem.rhcloud.com/doc/ch.dissem.msgpack/msgpack/badge.svg)](http://www.javadoc.io/doc/ch.dissem.msgpack/msgpack) -[![Apache 2](https://img.shields.io/badge/license-Apache_2.0-blue.svg)](https://raw.githubusercontent.com/Dissem/Jabit/master/LICENSE) - -This is a simple Java library for handling MessagePack data. It doesn't do any object mapping, but maps to special -objects representing MessagePack types. To build, use command `./gradlew build`. - -For most cases you might be better off using `org.msgpack:msgpack`, but I found that I needed something that generically -represents the internal structure of the data. - -msgpack uses Semantic Versioning, meaning as long as the major version doesn't change, nothing should break if you -update. Be aware though that this doesn't necessarily applies for SNAPSHOT builds and the development branch. - - -#### Master -[![Build Status](https://travis-ci.org/Dissem/MsgPack.svg?branch=master)](https://travis-ci.org/Dissem/MsgPack) -[![Code Quality](https://img.shields.io/codacy/eb92c25247b4444383b163304e57a3ce/master.svg)](https://www.codacy.com/app/chrigu-meyer/MsgPack/dashboard?bid=4122049) -[![Test Coverage](https://codecov.io/github/Dissem/MsgPack/coverage.svg?branch=master)](https://codecov.io/github/Dissem/MsgPack?branch=master) - -#### Develop -[![Build Status](https://travis-ci.org/Dissem/MsgPack.svg?branch=develop)](https://travis-ci.org/Dissem/MsgPack?branch=develop) -[![Code Quality](https://img.shields.io/codacy/eb92c25247b4444383b163304e57a3ce/develop.svg)](https://www.codacy.com/app/chrigu-meyer/MsgPack/dashboard?bid=4118049) -[![Test Coverage](https://codecov.io/github/Dissem/MsgPack/coverage.svg?branch=develop)](https://codecov.io/github/Dissem/MsgPack?branch=develop) - -### Limitations - -* There is no fallback to BigInteger for large integer type numbers, so there might be an integer overflow when reading - too large numbers -* `MPFloat` uses the data type you're using to decide on precision (float 32 or 64) - not the actual value. E.g. 0.5 - could be saved perfectly as a float 42, but if you provide a double value, it will be stored as float 64, wasting - 4 bytes. - -### Setup - -Add msgpack as Gradle dependency: -```Gradle -compile "ch.dissem.msgpack:msgpack:1.0.0" -``` - -### Usage - -#### Serialize Data - -First, you'll need to create some msgpack objects to serialize: -```Java -MPMap> object = new MPMap<>(); -object.put(new MPString("compact"), new MPBoolean(true)); -object.put(new MPString("schema"), new MPInteger(0)); -``` -or the shorthand version for simple types: -```Java -import static ch.dissem.msgpack.types.Utils.mp; - -MPMap> object = new MPMap<>(); -object.put(mp("compact"), mp(true)); -object.put(mp("schema"), mp(0)); -``` -then just use `pack(OutputStream)`: -```Java -OutputStream out = ...; -object.pack(out); -``` - - -#### Deserialize Data - -For deserializing data there is the reader object: -```Java -Reader reader = Reader.getInstance() -``` -just use `reader.read(InputStream)`. Unfortunately you'll need to make sure you got what you expected, the following -example might result in `ClassCastException` at weird places: -```Java -InputStream in = ...; -MPType read = reader.read(in); -MPMap map = (MPMap) read; -String value = map.get(mp("key")).getValue(); -```