-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bytes type and coverall test fixture (#16)
* Passing tests, coverall generation working Still need to complete coverall tests * Checkpointing because I don't want to lose it * Finished all coverall tests * rogue println
- Loading branch information
Showing
19 changed files
with
847 additions
and
128 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package {{ config.package_name() }}; | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
public enum FfiConverterByteArray implements FfiConverterRustBuffer<byte[]>{ | ||
INSTANCE; | ||
|
||
@Override | ||
public byte[] read(ByteBuffer buf) { | ||
int len = buf.getInt(); | ||
byte[] byteArr = new byte[len]; | ||
buf.get(byteArr); | ||
return byteArr; | ||
} | ||
|
||
@Override | ||
public long allocationSize(byte[] value) { | ||
return 4L + (long)value.length; | ||
} | ||
|
||
@Override | ||
public void write(byte[] value, ByteBuffer buf) { | ||
buf.putInt(value.length); | ||
buf.put(value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.