JRuby Mmap

This gem only supports JRuby.

JRuby Mmap is a Java JRuby extension wrapper over the Java NIO memory mapping.

See also

Installation

This gem only supports JRuby.

Add this line to your application's Gemfile:

gem 'jruby-mmap'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jruby-mmap

Building

Building uses Gradle. The build process compiles the Java classes, produces a jar file and copies the jar file in the project lib/jruby-mmap dir.

$ ./gradlew build

Usage

require "jruby-mmap"

BYTE_SIZE = 2048
FILE_PATH = "mmap-file-path"

mmap = Mmap::ByteBuffer.new(FILE_PATH, BYTE_SIZE)
mmap.put_bytes("foobar")
mmap.close

Tests

$ bundle install
$ bundle exec rspec

Author

Colin Surprenant on GitHub and Twitter.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/colinsurprenant/jruby-mmap.

JRuby Mmap is released under the Apache License, Version 2.0. See LICENSE.