Class List Method List File List

# Class: Vertx::Buffer

Inherits:
  Object
  - Object
  - Vertx::Buffer
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb

## Overview

Most data is shuffled around inside Vert.x using buffers.

A buffer is a sequence of zero or more bytes that can read from or written to and which expands automatically as necessary to accommodate any bytes written to it. You can perhaps think of a buffer as smart byte array.

Please consult the documentation for more information on buffers.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::Vertx::Buffer) buffer(param_1 = nil, param_2 = nil)
  Create a new buffer from a string and using the specified encoding.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (self) append_buffer(buff = nil, offset = nil, len = nil)
  Appends the specified Buffer starting at the offset using len to the end of this Buffer.
- - (self) append_byte(b = nil)
  Appends the specified byte to the end of the Buffer.
- - (self) append_double(d = nil)
  Appends the specified double to the end of the Buffer.
- - (self) append_float(f = nil)
  Appends the specified float to the end of the Buffer.
- - (self) append_int(i = nil)
  Appends the specified int to the end of the Buffer.
- - (self) append_int_le(i = nil)
  Appends the specified int to the end of the Buffer in the Little Endian Byte Order.
- - (self) append_long(l = nil)
  Appends the specified long to the end of the Buffer.
- - (self) append_long_le(l = nil)
  Appends the specified long to the end of the Buffer in the Little Endian Byte Order.
- - (self) append_medium(i = nil)
  Appends the specified 24bit int to the end of the Buffer.
- - (self) append_medium_le(i = nil)
  Appends the specified 24bit int to the end of the Buffer in the Little Endian Byte Order.
- - (self) append_short(s = nil)
  Appends the specified short to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.
- - (self) append_short_le(s = nil)
  Appends the specified short to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written.
- - (self) append_string(str = nil, enc = nil)
  Appends the specified String to the end of the Buffer with the encoding as specified by enc.
- - (self) append_unsigned_byte(b = nil)
  Appends the specified unsigned byte to the end of the Buffer.
- - (self) append_unsigned_int(i = nil)
  Appends the specified unsigned int to the end of the Buffer.
- - (self) append_unsigned_int_le(i = nil)
  Appends the specified unsigned int to the end of the Buffer in the Little Endian Byte Order.
- - (self) append_unsigned_short(s = nil)
  Appends the specified unsigned short to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.
- - (self) append_unsigned_short_le(s = nil)
  Appends the specified unsigned short to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written.
- - (::Vertx::Buffer) copy
  Returns a copy of the entire Buffer.
- - (::Vertx::Buffer) get_buffer(start = nil, _end = nil)
  Returns a copy of a sub-sequence the Buffer as a Buffer starting at position start and ending at position end - 1.
- - (Fixnum) get_byte(pos = nil)
  Returns the byte at position pos in the Buffer.
- - (Float) get_double(pos = nil)
  Returns the double at position pos in the Buffer.
- - (Float) get_float(pos = nil)
  Returns the float at position pos in the Buffer.
- - (Fixnum) get_int(pos = nil)
  Returns the int at position pos in the Buffer.
- - (Fixnum) get_int_le(pos = nil)
  Gets a 32-bit integer at the specified absolute index in this buffer with Little Endian Byte Order.
- - (Fixnum) get_long(pos = nil)
  Returns the long at position pos in the Buffer.
- - (Fixnum) get_long_le(pos = nil)
  Gets a 64-bit long integer at the specified absolute index in this buffer in Little Endian Byte Order.
- - (Fixnum) get_medium(pos = nil)
  Gets a 24-bit medium integer at the specified absolute index in this buffer.
- - (Fixnum) get_medium_le(pos = nil)
  Gets a 24-bit medium integer at the specified absolute index in this buffer in the Little Endian Byte Order.
- - (Fixnum) get_short(pos = nil)
  Returns the short at position pos in the Buffer.
- - (Fixnum) get_short_le(pos = nil)
  Gets a 16-bit short integer at the specified absolute index in this buffer in Little Endian Byte Order.
- - (String) get_string(start = nil, _end = nil, enc = nil)
  Returns a copy of a sub-sequence the Buffer as a String starting at position start and ending at position end - 1 interpreted as a String in the specified encoding.
- - (Fixnum) get_unsigned_byte(pos = nil)
  Returns the unsigned byte at position pos in the Buffer, as a short.
- - (Fixnum) get_unsigned_int(pos = nil)
  Returns the unsigned int at position pos in the Buffer, as a long.
- - (Fixnum) get_unsigned_int_le(pos = nil)
  Returns the unsigned int at position pos in the Buffer, as a long in Little Endian Byte Order.
- - (Fixnum) get_unsigned_medium(pos = nil)
  Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer.
- - (Fixnum) get_unsigned_medium_le(pos = nil)
  Gets an unsigned 24-bit medium integer at the specified absolute index in this buffer in Little Endian Byte Order.
- - (Fixnum) get_unsigned_short(pos = nil)
  Returns the unsigned short at position pos in the Buffer, as an int.
- - (Fixnum) get_unsigned_short_le(pos = nil)
  Gets an unsigned 16-bit short integer at the specified absolute index in this buffer in Little Endian Byte Order.
- - (Fixnum) length
  Returns the length of the buffer, measured in bytes.
- - (self) set_buffer(pos = nil, b = nil, offset = nil, len = nil)
  Sets the bytes at position pos in the Buffer to the bytes represented by the Buffer b on the given offset and len.
- - (self) set_byte(pos = nil, b = nil)
  Sets the byte at position pos in the Buffer to the value b.
- - (self) set_double(pos = nil, d = nil)
  Sets the double at position pos in the Buffer to the value d.
- - (self) set_float(pos = nil, f = nil)
  Sets the float at position pos in the Buffer to the value f.
- - (self) set_int(pos = nil, i = nil)
  Sets the int at position pos in the Buffer to the value i.
- - (self) set_int_le(pos = nil, i = nil)
  Sets the int at position pos in the Buffer to the value i in the Little Endian Byte Order.
- - (self) set_long(pos = nil, l = nil)
  Sets the long at position pos in the Buffer to the value l.
- - (self) set_long_le(pos = nil, l = nil)
  Sets the long at position pos in the Buffer to the value l in the Little Endian Byte Order.
- - (self) set_medium(pos = nil, i = nil)
  Sets the 24bit int at position pos in the Buffer to the value i.
- - (self) set_medium_le(pos = nil, i = nil)
  Sets the 24bit int at position pos in the Buffer to the value i.
- - (self) set_short(pos = nil, s = nil)
  Sets the short at position pos in the Buffer to the value s.
- - (self) set_short_le(pos = nil, s = nil)
  Sets the short at position pos in the Buffer to the value s in the Little Endian Byte Order.
- - (self) set_string(pos = nil, str = nil, enc = nil)
  Sets the bytes at position pos in the Buffer to the value of str encoded in encoding enc.
- - (self) set_unsigned_byte(pos = nil, b = nil)
  Sets the unsigned byte at position pos in the Buffer to the value b.
- - (self) set_unsigned_int(pos = nil, i = nil)
  Sets the unsigned int at position pos in the Buffer to the value i.
- - (self) set_unsigned_int_le(pos = nil, i = nil)
  Sets the unsigned int at position pos in the Buffer to the value i in the Little Endian Byte Order.
- - (self) set_unsigned_short(pos = nil, s = nil)
  Sets the unsigned short at position pos in the Buffer to the value s.
- - (self) set_unsigned_short_le(pos = nil, s = nil)
  Sets the unsigned short at position pos in the Buffer to the value s in the Little Endian Byte Order.
- - (::Vertx::Buffer) slice(start = nil, _end = nil)
  Returns a slice of this buffer.
- - (Object) to_json
  Returns a Json representation of the Buffer.
- - (Array<String,Object>) to_json_array
  Returns a Json array representation of the Buffer.
- - (Hash{String => Object}) to_json_object
  Returns a Json object representation of the Buffer.
- - (String) to_string(enc = nil)
  Returns a String representation of the Buffer with the encoding specified by enc.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    22
    23
    24
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 22

    def @@j_api_type.accept?(obj)
      obj.class == Buffer
    end

### + (`::Vertx::Buffer`) buffer + (`::Vertx::Buffer`) buffer(initialSizeHint) + (`::Vertx::Buffer`) buffer(string) + (`::Vertx::Buffer`) buffer(string, enc)

Create a new buffer from a string and using the specified encoding. The string will be encoded into the buffer using the specified encoding.

Overloads:

- + (`::Vertx::Buffer`) buffer(initialSizeHint)

  Parameters:

  - initialSizeHint (`Fixnum`) —
    the hint, in bytes
- + (`::Vertx::Buffer`) buffer(string)

  Parameters:

  - string (`String`) —
    the string
- + (`::Vertx::Buffer`) buffer(string, enc)

  Parameters:

  - string (`String`) —
    the string
  - enc (`String`)

Returns:

- (`::Vertx::Buffer`) —
  the buffer

Raises:

- (`ArgumentError`)

    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 48

    def self.buffer(param_1=nil,param_2=nil)
      if !block_given? && param_1 == nil && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCoreBuffer::Buffer.java_method(:buffer, []).call(),::Vertx::Buffer)
      elsif param_1.class == Fixnum && !block_given? && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCoreBuffer::Buffer.java_method(:buffer, [Java::int.java_class]).call(param_1),::Vertx::Buffer)
      elsif param_1.class == String && !block_given? && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCoreBuffer::Buffer.java_method(:buffer, [Java::java.lang.String.java_class]).call(param_1),::Vertx::Buffer)
      elsif param_1.class == String && param_2.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxCoreBuffer::Buffer.java_method(:buffer, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2),::Vertx::Buffer)
      end
      raise ArgumentError, "Invalid arguments when calling buffer(#{param_1},#{param_2})"
    end

### + (`Object`) j_api_type

    31
    32
    33
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 31

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    34
    35
    36
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 34

    def self.j_class
      Java::IoVertxCoreBuffer::Buffer.java_class
    end

### + (`Object`) unwrap(obj)

    28
    29
    30
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 28

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    25
    26
    27
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 25

    def @@j_api_type.wrap(obj)
      Buffer.new(obj)
    end

## Instance Method Details

### - (`self`) append_buffer(buff = nil, offset = nil, len = nil)

Appends the specified `Buffer` starting at the `offset` using `len` to the end of this Buffer. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- buff (`::Vertx::Buffer`) (defaults to: `nil`)
- offset (`Fixnum`) (defaults to: `nil`)
- len (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 289

    def append_buffer(buff=nil,offset=nil,len=nil)
      if buff.class.method_defined?(:j_del) && !block_given? && offset == nil && len == nil
        @j_del.java_method(:appendBuffer, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(buff.j_del)
        return self
      elsif buff.class.method_defined?(:j_del) && offset.class == Fixnum && len.class == Fixnum && !block_given?
        @j_del.java_method(:appendBuffer, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::int.java_class,Java::int.java_class]).call(buff.j_del,offset,len)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_buffer(#{buff},#{offset},#{len})"
    end

### - (`self`) append_byte(b = nil)

Appends the specified `byte` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- b (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    303
    304
    305
    306
    307
    308
    309
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 303

    def append_byte(b=nil)
      if b.class == Fixnum && !block_given?
        @j_del.java_method(:appendByte, [Java::byte.java_class]).call(::Vertx::Util::Utils.to_byte(b))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_byte(#{b})"
    end

### - (`self`) append_double(d = nil)

Appends the specified `double` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- d (`Float`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    468
    469
    470
    471
    472
    473
    474
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 468

    def append_double(d=nil)
      if d.class == Float && !block_given?
        @j_del.java_method(:appendDouble, [Java::double.java_class]).call(::Vertx::Util::Utils.to_double(d))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_double(#{d})"
    end

### - (`self`) append_float(f = nil)

Appends the specified `float` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- f (`Float`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    457
    458
    459
    460
    461
    462
    463
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 457

    def append_float(f=nil)
      if f.class == Float && !block_given?
        @j_del.java_method(:appendFloat, [Java::float.java_class]).call(::Vertx::Util::Utils.to_float(f))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_float(#{f})"
    end

### - (`self`) append_int(i = nil)

Appends the specified `int` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    325
    326
    327
    328
    329
    330
    331
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 325

    def append_int(i=nil)
      if i.class == Fixnum && !block_given?
        @j_del.java_method(:appendInt, [Java::int.java_class]).call(i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_int(#{i})"
    end

### - (`self`) append_int_le(i = nil)

Appends the specified `int` to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    336
    337
    338
    339
    340
    341
    342
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 336

    def append_int_le(i=nil)
      if i.class == Fixnum && !block_given?
        @j_del.java_method(:appendIntLE, [Java::int.java_class]).call(i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_int_le(#{i})"
    end

### - (`self`) append_long(l = nil)

Appends the specified `long` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- l (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    391
    392
    393
    394
    395
    396
    397
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 391

    def append_long(l=nil)
      if l.class == Fixnum && !block_given?
        @j_del.java_method(:appendLong, [Java::long.java_class]).call(l)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_long(#{l})"
    end

### - (`self`) append_long_le(l = nil)

Appends the specified `long` to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- l (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    402
    403
    404
    405
    406
    407
    408
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 402

    def append_long_le(l=nil)
      if l.class == Fixnum && !block_given?
        @j_del.java_method(:appendLongLE, [Java::long.java_class]).call(l)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_long_le(#{l})"
    end

### - (`self`) append_medium(i = nil)

Appends the specified 24bit `int` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    369
    370
    371
    372
    373
    374
    375
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 369

    def append_medium(i=nil)
      if i.class == Fixnum && !block_given?
        @j_del.java_method(:appendMedium, [Java::int.java_class]).call(i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_medium(#{i})"
    end

### - (`self`) append_medium_le(i = nil)

Appends the specified 24bit `int` to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    380
    381
    382
    383
    384
    385
    386
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 380

    def append_medium_le(i=nil)
      if i.class == Fixnum && !block_given?
        @j_del.java_method(:appendMediumLE, [Java::int.java_class]).call(i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_medium_le(#{i})"
    end

### - (`self`) append_short(s = nil)

Appends the specified `short` to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- s (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    413
    414
    415
    416
    417
    418
    419
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 413

    def append_short(s=nil)
      if s.class == Fixnum && !block_given?
        @j_del.java_method(:appendShort, [Java::short.java_class]).call(::Vertx::Util::Utils.to_short(s))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_short(#{s})"
    end

### - (`self`) append_short_le(s = nil)

Appends the specified `short` to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- s (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    424
    425
    426
    427
    428
    429
    430
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 424

    def append_short_le(s=nil)
      if s.class == Fixnum && !block_given?
        @j_del.java_method(:appendShortLE, [Java::short.java_class]).call(::Vertx::Util::Utils.to_short(s))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_short_le(#{s})"
    end

### - (`self`) append_string(str = nil, enc = nil)

Appends the specified `String` to the end of the Buffer with the encoding as specified by `enc`.

The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- str (`String`) (defaults to: `nil`)
- enc (`String`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 481

    def append_string(str=nil,enc=nil)
      if str.class == String && !block_given? && enc == nil
        @j_del.java_method(:appendString, [Java::java.lang.String.java_class]).call(str)
        return self
      elsif str.class == String && enc.class == String && !block_given?
        @j_del.java_method(:appendString, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(str,enc)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_string(#{str},#{enc})"
    end

### - (`self`) append_unsigned_byte(b = nil)

Appends the specified unsigned `byte` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- b (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    314
    315
    316
    317
    318
    319
    320
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 314

    def append_unsigned_byte(b=nil)
      if b.class == Fixnum && !block_given?
        @j_del.java_method(:appendUnsignedByte, [Java::short.java_class]).call(::Vertx::Util::Utils.to_short(b))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_unsigned_byte(#{b})"
    end

### - (`self`) append_unsigned_int(i = nil)

Appends the specified unsigned `int` to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    347
    348
    349
    350
    351
    352
    353
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 347

    def append_unsigned_int(i=nil)
      if i.class == Fixnum && !block_given?
        @j_del.java_method(:appendUnsignedInt, [Java::long.java_class]).call(i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_unsigned_int(#{i})"
    end

### - (`self`) append_unsigned_int_le(i = nil)

Appends the specified unsigned `int` to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    358
    359
    360
    361
    362
    363
    364
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 358

    def append_unsigned_int_le(i=nil)
      if i.class == Fixnum && !block_given?
        @j_del.java_method(:appendUnsignedIntLE, [Java::long.java_class]).call(i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_unsigned_int_le(#{i})"
    end

### - (`self`) append_unsigned_short(s = nil)

Appends the specified unsigned `short` to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- s (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    435
    436
    437
    438
    439
    440
    441
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 435

    def append_unsigned_short(s=nil)
      if s.class == Fixnum && !block_given?
        @j_del.java_method(:appendUnsignedShort, [Java::int.java_class]).call(s)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_unsigned_short(#{s})"
    end

### - (`self`) append_unsigned_short_le(s = nil)

Appends the specified unsigned `short` to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written.

Returns a reference to `this` so multiple operations can be appended together.

Parameters:

- s (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    446
    447
    448
    449
    450
    451
    452
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 446

    def append_unsigned_short_le(s=nil)
      if s.class == Fixnum && !block_given?
        @j_del.java_method(:appendUnsignedShortLE, [Java::int.java_class]).call(s)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling append_unsigned_short_le(#{s})"
    end

### - (`::Vertx::Buffer`) copy

Returns a copy of the entire Buffer.

Returns:

- (`::Vertx::Buffer`)

Raises:

- (`ArgumentError`)

    727
    728
    729
    730
    731
    732
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 727

    def copy
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:copy, []).call(),::Vertx::Buffer)
      end
      raise ArgumentError, "Invalid arguments when calling copy()"
    end

### - (`::Vertx::Buffer`) get_buffer(start = nil, _end = nil)

Returns a copy of a sub-sequence the Buffer as a Vertx::Buffer starting at position `start` and ending at position `end - 1`

Parameters:

- start (`Fixnum`) (defaults to: `nil`)
- _end (`Fixnum`) (defaults to: `nil`)

Returns:

- (`::Vertx::Buffer`)

Raises:

- (`ArgumentError`)

    262
    263
    264
    265
    266
    267
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 262

    def get_buffer(start=nil,_end=nil)
      if start.class == Fixnum && _end.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getBuffer, [Java::int.java_class,Java::int.java_class]).call(start,_end),::Vertx::Buffer)
      end
      raise ArgumentError, "Invalid arguments when calling get_buffer(#{start},#{_end})"
    end

### - (`Fixnum`) get_byte(pos = nil)

Returns the `byte` at position `pos` in the Buffer.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    98
    99
    100
    101
    102
    103
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 98

    def get_byte(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getByte, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_byte(#{pos})"
    end

### - (`Float`) get_double(pos = nil)

Returns the `double` at position `pos` in the Buffer.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Float`)

Raises:

- (`ArgumentError`)

    170
    171
    172
    173
    174
    175
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 170

    def get_double(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getDouble, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_double(#{pos})"
    end

### - (`Float`) get_float(pos = nil)

Returns the `float` at position `pos` in the Buffer.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Float`)

Raises:

- (`ArgumentError`)

    179
    180
    181
    182
    183
    184
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 179

    def get_float(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getFloat, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_float(#{pos})"
    end

### - (`Fixnum`) get_int(pos = nil)

Returns the `int` at position `pos` in the Buffer.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    116
    117
    118
    119
    120
    121
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 116

    def get_int(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getInt, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_int(#{pos})"
    end

### - (`Fixnum`) get_int_le(pos = nil)

Gets a 32-bit integer at the specified absolute `index` in this buffer with Little Endian Byte Order.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    125
    126
    127
    128
    129
    130
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 125

    def get_int_le(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getIntLE, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_int_le(#{pos})"
    end

### - (`Fixnum`) get_long(pos = nil)

Returns the `long` at position `pos` in the Buffer.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    152
    153
    154
    155
    156
    157
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 152

    def get_long(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getLong, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_long(#{pos})"
    end

### - (`Fixnum`) get_long_le(pos = nil)

Gets a 64-bit long integer at the specified absolute `index` in this buffer in Little Endian Byte Order.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    161
    162
    163
    164
    165
    166
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 161

    def get_long_le(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getLongLE, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_long_le(#{pos})"
    end

### - (`Fixnum`) get_medium(pos = nil)

Gets a 24-bit medium integer at the specified absolute `index` in this buffer.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    224
    225
    226
    227
    228
    229
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 224

    def get_medium(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getMedium, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_medium(#{pos})"
    end

### - (`Fixnum`) get_medium_le(pos = nil)

Gets a 24-bit medium integer at the specified absolute `index` in this buffer in the Little Endian Byte Order.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    233
    234
    235
    236
    237
    238
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 233

    def get_medium_le(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getMediumLE, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_medium_le(#{pos})"
    end

### - (`Fixnum`) get_short(pos = nil)

Returns the `short` at position `pos` in the Buffer.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    188
    189
    190
    191
    192
    193
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 188

    def get_short(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getShort, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_short(#{pos})"
    end

### - (`Fixnum`) get_short_le(pos = nil)

Gets a 16-bit short integer at the specified absolute `index` in this buffer in Little Endian Byte Order.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    197
    198
    199
    200
    201
    202
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 197

    def get_short_le(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getShortLE, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_short_le(#{pos})"
    end

### - (`String`) get_string(start = nil, _end = nil, enc = nil)

Returns a copy of a sub-sequence the Buffer as a `String` starting at position `start` and ending at position `end - 1` interpreted as a String in the specified encoding

Parameters:

- start (`Fixnum`) (defaults to: `nil`)
- _end (`Fixnum`) (defaults to: `nil`)
- enc (`String`) (defaults to: `nil`)

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    274
    275
    276
    277
    278
    279
    280
    281
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 274

    def get_string(start=nil,_end=nil,enc=nil)
      if start.class == Fixnum && _end.class == Fixnum && !block_given? && enc == nil
        return @j_del.java_method(:getString, [Java::int.java_class,Java::int.java_class]).call(start,_end)
      elsif start.class == Fixnum && _end.class == Fixnum && enc.class == String && !block_given?
        return @j_del.java_method(:getString, [Java::int.java_class,Java::int.java_class,Java::java.lang.String.java_class]).call(start,_end,enc)
      end
      raise ArgumentError, "Invalid arguments when calling get_string(#{start},#{_end},#{enc})"
    end

### - (`Fixnum`) get_unsigned_byte(pos = nil)

Returns the unsigned `byte` at position `pos` in the Buffer, as a `short`.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    107
    108
    109
    110
    111
    112
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 107

    def get_unsigned_byte(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getUnsignedByte, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_unsigned_byte(#{pos})"
    end

### - (`Fixnum`) get_unsigned_int(pos = nil)

Returns the unsigned `int` at position `pos` in the Buffer, as a `long`.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    134
    135
    136
    137
    138
    139
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 134

    def get_unsigned_int(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getUnsignedInt, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_unsigned_int(#{pos})"
    end

### - (`Fixnum`) get_unsigned_int_le(pos = nil)

Returns the unsigned `int` at position `pos` in the Buffer, as a `long` in Little Endian Byte Order.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    143
    144
    145
    146
    147
    148
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 143

    def get_unsigned_int_le(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getUnsignedIntLE, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_unsigned_int_le(#{pos})"
    end

### - (`Fixnum`) get_unsigned_medium(pos = nil)

Gets an unsigned 24-bit medium integer at the specified absolute `index` in this buffer.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    242
    243
    244
    245
    246
    247
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 242

    def get_unsigned_medium(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getUnsignedMedium, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_unsigned_medium(#{pos})"
    end

### - (`Fixnum`) get_unsigned_medium_le(pos = nil)

Gets an unsigned 24-bit medium integer at the specified absolute `index` in this buffer in Little Endian Byte Order.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    251
    252
    253
    254
    255
    256
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 251

    def get_unsigned_medium_le(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getUnsignedMediumLE, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_unsigned_medium_le(#{pos})"
    end

### - (`Fixnum`) get_unsigned_short(pos = nil)

Returns the unsigned `short` at position `pos` in the Buffer, as an `int`.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    206
    207
    208
    209
    210
    211
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 206

    def get_unsigned_short(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getUnsignedShort, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_unsigned_short(#{pos})"
    end

### - (`Fixnum`) get_unsigned_short_le(pos = nil)

Gets an unsigned 16-bit short integer at the specified absolute `index` in this buffer in Little Endian Byte Order.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    215
    216
    217
    218
    219
    220
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 215

    def get_unsigned_short_le(pos=nil)
      if pos.class == Fixnum && !block_given?
        return @j_del.java_method(:getUnsignedShortLE, [Java::int.java_class]).call(pos)
      end
      raise ArgumentError, "Invalid arguments when calling get_unsigned_short_le(#{pos})"
    end

### - (`Fixnum`) length

Returns the length of the buffer, measured in bytes. All positions are indexed from zero.

Returns:

- (`Fixnum`)

Raises:

- (`ArgumentError`)

    719
    720
    721
    722
    723
    724
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 719

    def length
      if !block_given?
        return @j_del.java_method(:length, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling length()"
    end

### - (`self`) set_buffer(pos = nil, b = nil, offset = nil, len = nil)

Sets the bytes at position `pos` in the Buffer to the bytes represented by the `Buffer b` on the given `offset` and `len`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- b (`::Vertx::Buffer`) (defaults to: `nil`)
- offset (`Fixnum`) (defaults to: `nil`)
- len (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 690

    def set_buffer(pos=nil,b=nil,offset=nil,len=nil)
      if pos.class == Fixnum && b.class.method_defined?(:j_del) && !block_given? && offset == nil && len == nil
        @j_del.java_method(:setBuffer, [Java::int.java_class,Java::IoVertxCoreBuffer::Buffer.java_class]).call(pos,b.j_del)
        return self
      elsif pos.class == Fixnum && b.class.method_defined?(:j_del) && offset.class == Fixnum && len.class == Fixnum && !block_given?
        @j_del.java_method(:setBuffer, [Java::int.java_class,Java::IoVertxCoreBuffer::Buffer.java_class,Java::int.java_class,Java::int.java_class]).call(pos,b.j_del,offset,len)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_buffer(#{pos},#{b},#{offset},#{len})"
    end

### - (`self`) set_byte(pos = nil, b = nil)

Sets the `byte` at position `pos` in the Buffer to the value `b`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- b (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    496
    497
    498
    499
    500
    501
    502
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 496

    def set_byte(pos=nil,b=nil)
      if pos.class == Fixnum && b.class == Fixnum && !block_given?
        @j_del.java_method(:setByte, [Java::int.java_class,Java::byte.java_class]).call(pos,::Vertx::Util::Utils.to_byte(b))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_byte(#{pos},#{b})"
    end

### - (`self`) set_double(pos = nil, d = nil)

Sets the `double` at position `pos` in the Buffer to the value `d`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- d (`Float`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    616
    617
    618
    619
    620
    621
    622
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 616

    def set_double(pos=nil,d=nil)
      if pos.class == Fixnum && d.class == Float && !block_given?
        @j_del.java_method(:setDouble, [Java::int.java_class,Java::double.java_class]).call(pos,::Vertx::Util::Utils.to_double(d))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_double(#{pos},#{d})"
    end

### - (`self`) set_float(pos = nil, f = nil)

Sets the `float` at position `pos` in the Buffer to the value `f`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- f (`Float`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    628
    629
    630
    631
    632
    633
    634
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 628

    def set_float(pos=nil,f=nil)
      if pos.class == Fixnum && f.class == Float && !block_given?
        @j_del.java_method(:setFloat, [Java::int.java_class,Java::float.java_class]).call(pos,::Vertx::Util::Utils.to_float(f))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_float(#{pos},#{f})"
    end

### - (`self`) set_int(pos = nil, i = nil)

Sets the `int` at position `pos` in the Buffer to the value `i`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    520
    521
    522
    523
    524
    525
    526
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 520

    def set_int(pos=nil,i=nil)
      if pos.class == Fixnum && i.class == Fixnum && !block_given?
        @j_del.java_method(:setInt, [Java::int.java_class,Java::int.java_class]).call(pos,i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_int(#{pos},#{i})"
    end

### - (`self`) set_int_le(pos = nil, i = nil)

Sets the `int` at position `pos` in the Buffer to the value `i` in the Little Endian Byte Order.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    532
    533
    534
    535
    536
    537
    538
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 532

    def set_int_le(pos=nil,i=nil)
      if pos.class == Fixnum && i.class == Fixnum && !block_given?
        @j_del.java_method(:setIntLE, [Java::int.java_class,Java::int.java_class]).call(pos,i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_int_le(#{pos},#{i})"
    end

### - (`self`) set_long(pos = nil, l = nil)

Sets the `long` at position `pos` in the Buffer to the value `l`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- l (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    592
    593
    594
    595
    596
    597
    598
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 592

    def set_long(pos=nil,l=nil)
      if pos.class == Fixnum && l.class == Fixnum && !block_given?
        @j_del.java_method(:setLong, [Java::int.java_class,Java::long.java_class]).call(pos,l)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_long(#{pos},#{l})"
    end

### - (`self`) set_long_le(pos = nil, l = nil)

Sets the `long` at position `pos` in the Buffer to the value `l` in the Little Endian Byte Order.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- l (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    604
    605
    606
    607
    608
    609
    610
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 604

    def set_long_le(pos=nil,l=nil)
      if pos.class == Fixnum && l.class == Fixnum && !block_given?
        @j_del.java_method(:setLongLE, [Java::int.java_class,Java::long.java_class]).call(pos,l)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_long_le(#{pos},#{l})"
    end

### - (`self`) set_medium(pos = nil, i = nil)

Sets the 24bit `int` at position `pos` in the Buffer to the value `i`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    568
    569
    570
    571
    572
    573
    574
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 568

    def set_medium(pos=nil,i=nil)
      if pos.class == Fixnum && i.class == Fixnum && !block_given?
        @j_del.java_method(:setMedium, [Java::int.java_class,Java::int.java_class]).call(pos,i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_medium(#{pos},#{i})"
    end

### - (`self`) set_medium_le(pos = nil, i = nil)

Sets the 24bit `int` at position `pos` in the Buffer to the value `i`. in the Little Endian Byte Order

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    580
    581
    582
    583
    584
    585
    586
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 580

    def set_medium_le(pos=nil,i=nil)
      if pos.class == Fixnum && i.class == Fixnum && !block_given?
        @j_del.java_method(:setMediumLE, [Java::int.java_class,Java::int.java_class]).call(pos,i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_medium_le(#{pos},#{i})"
    end

### - (`self`) set_short(pos = nil, s = nil)

Sets the `short` at position `pos` in the Buffer to the value `s`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- s (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    640
    641
    642
    643
    644
    645
    646
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 640

    def set_short(pos=nil,s=nil)
      if pos.class == Fixnum && s.class == Fixnum && !block_given?
        @j_del.java_method(:setShort, [Java::int.java_class,Java::short.java_class]).call(pos,::Vertx::Util::Utils.to_short(s))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_short(#{pos},#{s})"
    end

### - (`self`) set_short_le(pos = nil, s = nil)

Sets the `short` at position `pos` in the Buffer to the value `s` in the Little Endian Byte Order.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- s (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    652
    653
    654
    655
    656
    657
    658
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 652

    def set_short_le(pos=nil,s=nil)
      if pos.class == Fixnum && s.class == Fixnum && !block_given?
        @j_del.java_method(:setShortLE, [Java::int.java_class,Java::short.java_class]).call(pos,::Vertx::Util::Utils.to_short(s))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_short_le(#{pos},#{s})"
    end

### - (`self`) set_string(pos = nil, str = nil, enc = nil)

Sets the bytes at position `pos` in the Buffer to the value of `str` encoded in encoding `enc`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- str (`String`) (defaults to: `nil`)
- enc (`String`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 706

    def set_string(pos=nil,str=nil,enc=nil)
      if pos.class == Fixnum && str.class == String && !block_given? && enc == nil
        @j_del.java_method(:setString, [Java::int.java_class,Java::java.lang.String.java_class]).call(pos,str)
        return self
      elsif pos.class == Fixnum && str.class == String && enc.class == String && !block_given?
        @j_del.java_method(:setString, [Java::int.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(pos,str,enc)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_string(#{pos},#{str},#{enc})"
    end

### - (`self`) set_unsigned_byte(pos = nil, b = nil)

Sets the unsigned `byte` at position `pos` in the Buffer to the value `b`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- b (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    508
    509
    510
    511
    512
    513
    514
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 508

    def set_unsigned_byte(pos=nil,b=nil)
      if pos.class == Fixnum && b.class == Fixnum && !block_given?
        @j_del.java_method(:setUnsignedByte, [Java::int.java_class,Java::short.java_class]).call(pos,::Vertx::Util::Utils.to_short(b))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_unsigned_byte(#{pos},#{b})"
    end

### - (`self`) set_unsigned_int(pos = nil, i = nil)

Sets the unsigned `int` at position `pos` in the Buffer to the value `i`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    544
    545
    546
    547
    548
    549
    550
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 544

    def set_unsigned_int(pos=nil,i=nil)
      if pos.class == Fixnum && i.class == Fixnum && !block_given?
        @j_del.java_method(:setUnsignedInt, [Java::int.java_class,Java::long.java_class]).call(pos,i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_unsigned_int(#{pos},#{i})"
    end

### - (`self`) set_unsigned_int_le(pos = nil, i = nil)

Sets the unsigned `int` at position `pos` in the Buffer to the value `i` in the Little Endian Byte Order.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- i (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    556
    557
    558
    559
    560
    561
    562
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 556

    def set_unsigned_int_le(pos=nil,i=nil)
      if pos.class == Fixnum && i.class == Fixnum && !block_given?
        @j_del.java_method(:setUnsignedIntLE, [Java::int.java_class,Java::long.java_class]).call(pos,i)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_unsigned_int_le(#{pos},#{i})"
    end

### - (`self`) set_unsigned_short(pos = nil, s = nil)

Sets the unsigned `short` at position `pos` in the Buffer to the value `s`.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- s (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    664
    665
    666
    667
    668
    669
    670
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 664

    def set_unsigned_short(pos=nil,s=nil)
      if pos.class == Fixnum && s.class == Fixnum && !block_given?
        @j_del.java_method(:setUnsignedShort, [Java::int.java_class,Java::int.java_class]).call(pos,s)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_unsigned_short(#{pos},#{s})"
    end

### - (`self`) set_unsigned_short_le(pos = nil, s = nil)

Sets the unsigned `short` at position `pos` in the Buffer to the value `s` in the Little Endian Byte Order.

The buffer will expand as necessary to accommodate any value written.

Parameters:

- pos (`Fixnum`) (defaults to: `nil`)
- s (`Fixnum`) (defaults to: `nil`)

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    676
    677
    678
    679
    680
    681
    682
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 676

    def set_unsigned_short_le(pos=nil,s=nil)
      if pos.class == Fixnum && s.class == Fixnum && !block_given?
        @j_del.java_method(:setUnsignedShortLE, [Java::int.java_class,Java::int.java_class]).call(pos,s)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_unsigned_short_le(#{pos},#{s})"
    end

### - (`::Vertx::Buffer`) slice(start = nil, _end = nil)

Returns a slice of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks.

Parameters:

- start (`Fixnum`) (defaults to: `nil`)
- _end (`Fixnum`) (defaults to: `nil`)

Returns:

- (`::Vertx::Buffer`)

Raises:

- (`ArgumentError`)

    739
    740
    741
    742
    743
    744
    745
    746
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 739

    def slice(start=nil,_end=nil)
      if !block_given? && start == nil && _end == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:slice, []).call(),::Vertx::Buffer)
      elsif start.class == Fixnum && _end.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:slice, [Java::int.java_class,Java::int.java_class]).call(start,_end),::Vertx::Buffer)
      end
      raise ArgumentError, "Invalid arguments when calling slice(#{start},#{_end})"
    end

### - (`Object`) to_json

Returns a Json representation of the Buffer.

Returns:

- (`Object`) —
  a JSON element which can be a , , String, ...etc if the buffer contains an array, object, string, ...etc

Raises:

- (`ArgumentError`)

    89
    90
    91
    92
    93
    94
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 89

    def to_json
      if !block_given?
        return ::Vertx::Util::Utils.from_object(@j_del.java_method(:toJson, []).call())
      end
      raise ArgumentError, "Invalid arguments when calling to_json()"
    end

### - (`Array<String,Object>`) to_json_array

Returns a Json array representation of the Buffer.

Returns:

- (`Array<String,Object>`)

Raises:

- (`ArgumentError`)

    81
    82
    83
    84
    85
    86
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 81

    def to_json_array
      if !block_given?
        return @j_del.java_method(:toJsonArray, []).call() != nil ? JSON.parse(@j_del.java_method(:toJsonArray, []).call().encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling to_json_array()"
    end

### - (`Hash{String => Object}`) to_json_object

Returns a Json object representation of the Buffer.

Returns:

- (`Hash{String => Object}`)

Raises:

- (`ArgumentError`)

    73
    74
    75
    76
    77
    78
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 73

    def to_json_object
      if !block_given?
        return @j_del.java_method(:toJsonObject, []).call() != nil ? JSON.parse(@j_del.java_method(:toJsonObject, []).call().encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling to_json_object()"
    end

### - (`String`) to_string(enc = nil)

Returns a `String` representation of the Buffer with the encoding specified by `enc`

Parameters:

- enc (`String`) (defaults to: `nil`)

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    63
    64
    65
    66
    67
    68
    69
    70
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/buffer.rb', line 63

    def to_string(enc=nil)
      if !block_given? && enc == nil
        return @j_del.java_method(:toString, []).call()
      elsif enc.class == String && !block_given?
        return @j_del.java_method(:toString, [Java::java.lang.String.java_class]).call(enc)
      end
      raise ArgumentError, "Invalid arguments when calling to_string(#{enc})"
    end