Skip to content

Commit

Permalink
Eliminate jstructural
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed May 4, 2024
1 parent 8cd808a commit b10037a
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 507 deletions.
43 changes: 43 additions & 0 deletions README.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

## jeucreader

The `jeucreader` package provides an interface for reading Unicode codepoints
one at a time.

## Features

* Unicode codepoint reader interface.
* High coverage test suite.
* Written in pure Java 21 with no dependencies.
* [OSGi-ready](https://www.osgi.org/)
* [JPMS-ready](https://en.wikipedia.org/wiki/Java_Platform_Module_System)
* ISC license.

## Motivation

For some reason, Java does not expose any interface to read individual Unicode
codepoints from any kind of I/O stream. It _does_ provide methods to, for
example, read text into a `String` and then iterate over the codepoints of
the `String`.

The `jeucreader` package attempts to provide this missing functionality.

## Usage

Given a `java.io.Reader r`, instantiate a `UnicodeCharacterReaderType` and
use it to read individual codepoints:

```
Reader r;

try (var u = UnicodeCharacterReader.newReader(r)) {
int c0 = u.readCodePoint();
int c1 = u.readCodePoint();
int c2 = u.readCodePoint();
...
}
```

On consuming malformed text, the reader may raise subtypes of `IOException`
such as `InvalidSurrogatePair`, `MissingLowSurrogate`, `OrphanLowSurrogate`,
and etc.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,47 @@ jeucreader
| OpenJDK (Temurin) LTS | Linux | [![Build (OpenJDK (Temurin) LTS, Linux)](https://img.shields.io/github/actions/workflow/status/io7m-com/jeucreader/main.linux.temurin.lts.yml)](https://www.github.com/io7m-com/jeucreader/actions?query=workflow%3Amain.linux.temurin.lts)|
| OpenJDK (Temurin) Current | Windows | [![Build (OpenJDK (Temurin) Current, Windows)](https://img.shields.io/github/actions/workflow/status/io7m-com/jeucreader/main.windows.temurin.current.yml)](https://www.github.com/io7m-com/jeucreader/actions?query=workflow%3Amain.windows.temurin.current)|
| OpenJDK (Temurin) LTS | Windows | [![Build (OpenJDK (Temurin) LTS, Windows)](https://img.shields.io/github/actions/workflow/status/io7m-com/jeucreader/main.windows.temurin.lts.yml)](https://www.github.com/io7m-com/jeucreader/actions?query=workflow%3Amain.windows.temurin.lts)|

## jeucreader

The `jeucreader` package provides an interface for reading Unicode codepoints
one at a time.

## Features

* Unicode codepoint reader interface.
* High coverage test suite.
* Written in pure Java 21 with no dependencies.
* [OSGi-ready](https://www.osgi.org/)
* [JPMS-ready](https://en.wikipedia.org/wiki/Java_Platform_Module_System)
* ISC license.

## Motivation

For some reason, Java does not expose any interface to read individual Unicode
codepoints from any kind of I/O stream. It _does_ provide methods to, for
example, read text into a `String` and then iterate over the codepoints of
the `String`.

The `jeucreader` package attempts to provide this missing functionality.

## Usage

Given a `java.io.Reader r`, instantiate a `UnicodeCharacterReaderType` and
use it to read individual codepoints:

```
Reader r;
try (var u = UnicodeCharacterReader.newReader(r)) {
int c0 = u.readCodePoint();
int c1 = u.readCodePoint();
int c2 = u.readCodePoint();
...
}
```

On consuming malformed text, the reader may raise subtypes of `IOException`
such as `InvalidSurrogatePair`, `MissingLowSurrogate`, `OrphanLowSurrogate`,
and etc.

215 changes: 0 additions & 215 deletions com.io7m.jeucreader.documentation/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit b10037a

Please sign in to comment.