}
@JRubyMethod(name = "put_buffer", required = 3)
public IRubyObject put_buffer(ThreadContext context, IRubyObject off, IRubyObject str, IRubyObject len_) {
ByteList bl = str.convertToString().getByteList();
int len = Math.min(bl.length(), Util.int32Value(len_));
getMemoryIO().put(getOffset(off), bl.unsafeBytes(), bl.begin(), len);
return context.getRuntime().newFixnum(len);
}
@JRubyMethod(name = "free")
public IRubyObject free(ThreadContext context) {
// Just let the GC collect and free the pointer