An open API service indexing awesome lists of open source software.

https://github.com/abilng/ndjson

ndjson for Java
https://github.com/abilng/ndjson

java mvn ndjson

Last synced: about 2 months ago
JSON representation

ndjson for Java

Awesome Lists containing this project

README

        

# ndjson

[![Build Status](https://github.com/abilng/ndjson/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/abilng/ndjson/actions/workflows/maven.yml)
[![Maven Central](https://img.shields.io/maven-central/v/in.abilng/ndjson.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22in.abilng%22%20AND%20a:%22ndjson%22)

Java library for creating and parsing [ND-JSON](http://ndjson.org/)

Uses [Jackson JSON parser](https://github.com/FasterXML/jackson)

## Usage

**Deserialization**

```java
NdJsonObjectMapper ndJsonObjectMapper = new NdJsonObjectMapper();
InputStream is = ....;
Stream readValue = ndJsonObjectMapper.readValue(is, Car.class);
```

**Serialization**

```java
NdJsonObjectMapper ndJsonObjectMapper = new NdJsonObjectMapper();
OutputStream out = ... ;
Stream carStream = ...;
ndJsonObjectMapper.writeValue(out, carStream);
```

## How to add NDJSON to your project

Maven:
```xml

in.abilng
ndjson
1.0.1

```

SBT:
```sc
libraryDependencies += "in.abilng" % "ndjson"
```