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
- Host: GitHub
- URL: https://github.com/abilng/ndjson
- Owner: abilng
- License: apache-2.0
- Created: 2018-10-13T15:52:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-05T07:34:00.000Z (about 2 months ago)
- Last Synced: 2025-03-05T08:31:51.544Z (about 2 months ago)
- Topics: java, mvn, ndjson
- Language: Java
- Homepage: https://www.abilng.in/ndjson/
- Size: 515 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# ndjson
[](https://github.com/abilng/ndjson/actions/workflows/maven.yml)
[](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:
```xmlin.abilng
ndjson
1.0.1```
SBT:
```sc
libraryDependencies += "in.abilng" % "ndjson"
```