8000 GitHub - JasonRuckman/jaio: Java API for libaio
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

JasonRuckman/jaio

< 8000 a type="button" aria-label="Go to Tags page" href="/JasonRuckman/jaio/tags" class="prc-Button-ButtonBase-c50BI OverviewContent-module__Button_1--_1Ng2" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="invisible" aria-describedby=":Rmlab:-loading-announcement">
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jaio

A Java API for libaio.

Building jaio

  • Build libjaio:
cd libjaio
mkdir Release
cd Release
cmake -DCMAKE_BUILD_TYPE=RELEASE ..
  • Build jaio:
mvn -DskipTests install

API usage

The following code snippet shows how to create an AIO queue and perform an asynchronous read operation:

AsynchronousIOQueue aio = new AsynchronousIOQueue(10);
AsynchronousIOOperationArray ops = new AsynchronousIOOperationArray(1);
ByteBuffer dest = ByteBuffer.allocateDirect(512);
File file = new File(FileSystems.getDefault().getPath("/tmp/test"),
		OpenOption.DIRECT, OpenOption.READ, OpenOption.WRITE);
Integer i = 5;
AsynchronousIORead<Integer> read = new AsynchronousIORead();
read.set(file, dest, 0, i);
ops.set(0, read);
aio.submit(ops);
AsynchronousIOResultArray<Integer> result = new AsynchronousIOResultArray(1);
int n;
do {
	n = aio.poll(result);
} while (n == 0);
System.out.println("result: " + result.get(0).getResult());
while (dest.hasRemaining()) {
	System.out.print((byte)dest.get());
}
System.out.println();
aio.close();

Contributions

PRs are always welcome. Please fork, and make necessary modifications you propose, and let us know.

Contact

If you have questions or suggestions, feel free to post at:

https://groups.google.com/forum/#!forum/zrlio-users

or email: zrlio-users@googlegroups.com

About

Java API for libaio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 83.6%
  • C++ 9.7%
  • C 5.6%
  • CMake 1.1%
0