Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Add JBuffer, JByteBuffer to enable fast copying to and from `Uint…
Browse files Browse the repository at this point in the history
…8List` (#390)

`JBuffer` is now the default binding for `java.nio.Buffer` and `JByteBuffer` for `java.nio.ByteBuffer`.
  • Loading branch information
HosseinYousefi committed Sep 13, 2023
1 parent 7c83776 commit 4443ceb
Show file tree
Hide file tree
Showing 45 changed files with 1,071 additions and 175 deletions.
54 changes: 39 additions & 15 deletions jni/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,57 @@
## 0.7.0

- **Breaking Change** ([#387](https://github.com/dart-lang/jnigen/issues/387)):
Added `JBuffer` and `JByteBuffer` classes as default classes for
`java.nio.Buffer` and `java.nio.ByteBuffer` respectively.
- **Breaking Change**: Made the type classes `final`.
- Fixed a bug where `addAll`, `removeAll` and `retainAll` in `JSet` would run
their respective operation twice.
- Fixed a bug where `JList.insertAll` would not throw the potentially thrown
Java exception.

## 0.6.1
* Depend on the stable version of Dart 3.1.

- Depend on the stable version of Dart 3.1.

## 0.6.0
* **Breaking Change** ([#131](https://github.com/dart-lang/jnigen/issues/131)): Renamed `delete*` to `release*`.
* Added `PortProxy` and related methods used for interface implementation.
* Added the missing binding for `java.lang.Character`.

- **Breaking Change** ([#131](https://github.com/dart-lang/jnigen/issues/131)):
Renamed `delete*` to `release*`.
- Added `PortProxy` and related methods used for interface implementation.
- Added the missing binding for `java.lang.Character`.

## 0.5.0
* **Breaking Change** ([#137](https://github.com/dart-lang/jnigen/issues/137)): Java primitive types are now all lowercase like `jint`, `jshort`, ...
* The bindings for `java.util.Set`, `java.util.Map`, `java.util.List` and the numeric types like `java.lang.Integer`, `java.lang.Boolean`, ... are now included in `package:jni`.

- **Breaking Change** ([#137](https://github.com/dart-lang/jnigen/issues/137)):
Java primitive types are now all lowercase like `jint`, `jshort`, ...
- The bindings for `java.util.Set`, `java.util.Map`, `java.util.List` and the
numeric types like `java.lang.Integer`, `java.lang.Boolean`, ... are now
included in `package:jni`.

## 0.4.0
* Type classes now have `superCount` and `superType` getters used for type inference.

- Type classes now have `superCount` and `superType` getters used for type
inference.

## 0.3.0
* Added `PortContinuation` used for `suspend fun` in Kotlin.
* `dartjni` now depends on `dart_api_dl.h`.

- Added `PortContinuation` used for `suspend fun` in Kotlin.
- `dartjni` now depends on `dart_api_dl.h`.

## 0.2.1
* Added `.clang-format` to pub.

- Added `.clang-format` to pub.

## 0.2.0
* Added array support
* Added generic support
* `JniX` turned into `JX` for a more terse code.

- Added array support
- Added generic support
- `JniX` turned into `JX` for a more terse code.

## 0.1.1
* Windows support for running tests and examples on development machines.

- Windows support for running tests and examples on development machines.

## 0.1.0
* Initial version: Android and Linux support, JObject API

- Initial version: Android and Linux support, JObject API
1 change: 1 addition & 0 deletions jni/lib/jni.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export 'src/jobject.dart';
export 'src/jprimitives.dart';
export 'src/jreference.dart' show JReferenceUseExtension;
export 'src/lang/lang.dart';
export 'src/nio/nio.dart';
export 'src/util/util.dart';

export 'package:ffi/ffi.dart' show using, Arena;
Expand Down
8 changes: 8 additions & 0 deletions jni/lib/jni_symbols.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,11 @@ files:
'java.lang.Object': DECLARED
V:
'java.lang.Object': DECLARED
'java.nio.Buffer':
name: JBuffer
type_class: JBufferType
super_count: 1
'java.nio.ByteBuffer':
name: JByteBuffer
type_class: JByteBufferType
super_count: 2
2 changes: 1 addition & 1 deletion jni/lib/src/jarray.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'jobject.dart';
import 'jprimitives.dart';
import 'types.dart';

class JArrayType<T> extends JObjType<JArray<T>> {
final class JArrayType<T> extends JObjType<JArray<T>> {
final JType<T> elementType;

const JArrayType(this.elementType);
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/jobject.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import 'types.dart';
// type switch like a regular type.
typedef _VoidType = void;

class JObjectType extends JObjType<JObject> {
final class JObjectType extends JObjType<JObject> {
const JObjectType();

@override
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/lang/jboolean.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '../jni.dart';
import '../third_party/generated_bindings.dart';
import '../types.dart';

class JBooleanType extends JObjType<JBoolean> {
final class JBooleanType extends JObjType<JBoolean> {
const JBooleanType();

@override
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/lang/jbyte.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '../third_party/generated_bindings.dart';
import '../types.dart';
import 'jnumber.dart';

class JByteType extends JObjType<JByte> {
final class JByteType extends JObjType<JByte> {
const JByteType();

@override
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/lang/jcharacter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '../jvalues.dart';
import '../third_party/generated_bindings.dart';
import '../types.dart';

class JCharacterType extends JObjType<JCharacter> {
final class JCharacterType extends JObjType<JCharacter> {
const JCharacterType();

@override
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/lang/jdouble.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../third_party/generated_bindings.dart';
import '../types.dart';
import 'jnumber.dart';

class JDoubleType extends JObjType<JDouble> {
final class JDoubleType extends JObjType<JDouble> {
const JDoubleType();

@override
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/lang/jfloat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '../third_party/generated_bindings.dart';
import '../types.dart';
import 'jnumber.dart';

class JFloatType extends JObjType<JFloat> {
final class JFloatType extends JObjType<JFloat> {
const JFloatType();

@override
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/lang/jinteger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '../third_party/generated_bindings.dart';
import '../types.dart';
import 'jnumber.dart';

class JIntegerType extends JObjType<JInteger> {
final class JIntegerType extends JObjType<JInteger> {
const JIntegerType();

@override
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/lang/jlong.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import '../third_party/generated_bindings.dart';
import '../types.dart';
import 'jnumber.dart';

class JLongType extends JObjType<JLong> {
final class JLongType extends JObjType<JLong> {
const JLongType();

@override
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/lang/jnumber.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'jinteger.dart';
import 'jlong.dart';
import 'jshort.dart';

class JNumberType extends JObjType<JNumber> {
final class JNumberType extends JObjType<JNumber> {
const JNumberType();

@override
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/lang/jshort.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '../third_party/generated_bindings.dart';
import '../types.dart';
import 'jnumber.dart';

class JShortType extends JObjType<JShort> {
final class JShortType extends JObjType<JShort> {
const JShortType();

@override
Expand Down
2 changes: 1 addition & 1 deletion jni/lib/src/lang/jstring.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import '../jobject.dart';
import '../third_party/generated_bindings.dart';
import '../types.dart';

class JStringType extends JObjType<JString> {
final class JStringType extends JObjType<JString> {
const JStringType();

@override
Expand Down
Loading

0 comments on commit 4443ceb

Please sign in to comment.