Skip to content

Incorrect implementation of JByteBuffer.array #1920

@brianquinlan

Description

@brianquinlan

This is with:

dependencies:
  jni: ^0.13.0

Repro:

import 'dart:typed_data';
import 'package:jni/jni.dart';

void main() {
    final l = Uint8List.fromList([1, 2, 3, 4]);
    final bb = JByteBuffer.fromList(l);

    print(l);
    print(bb.array);
    print(bb.array.getRange(0, 4));
}


Output:

[1, 2, 3, 4]
(0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0)
[0, 0, 0, 0]

Metadata

Metadata

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions