Class: Vertx::Buffer
- Inherits:
-
Object
- Object
- Vertx::Buffer
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb
Overview
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.
Class Method Summary (collapse)
-
+ (::Vertx::Buffer) buffer(param_1 = nil, param_2 = nil)
Create a new buffer from a string and using the specified encoding.
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_long(l = nil)
Appends the specified long to the end of the Buffer.
-
- (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_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_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.
-
- (::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_long(pos = nil)
Returns the long at position pos in the Buffer.
-
- (Fixnum) get_short(pos = nil)
Returns the short at position pos in the Buffer.
-
- (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_short(pos = nil)
Returns the unsigned short at position pos in the Buffer, as an int.
-
- (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_long(pos = nil, l = nil)
Sets the long at position pos in the Buffer to the value l.
-
- (self) set_short(pos = nil, s = nil)
Sets the short at position pos in the Buffer to the value s.
-
- (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.
-
- (::Vertx::Buffer) 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_short(pos = nil, s = nil)
Sets the unsigned short at position pos in the Buffer to the value s.
-
- (::Vertx::Buffer) slice(start = nil, _end = nil)
Returns a slice of this buffer.
-
- (String) to_string(enc = nil)
Returns a String representation of the Buffer with the encoding specified by enc.
Class Method Details
+ (::Vertx::Buffer) buffer + (::Vertx::Buffer) buffer(initialSizeHint) + (::Vertx::Buffer) buffer(string) + (::Vertx::Buffer) buffer(string, enc)
32 33 34 35 36 37 38 39 40 41 42 43 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 32 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 |
Instance Method Details
- (self) append_buffer(buff = nil, offset = nil, len = nil)
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.
166 167 168 169 170 171 172 173 174 175 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 166 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)
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.
180 181 182 183 184 185 186 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 180 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)
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.
268 269 270 271 272 273 274 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 268 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)
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.
257 258 259 260 261 262 263 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 257 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)
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.
202 203 204 205 206 207 208 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 202 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_long(l = nil)
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.
224 225 226 227 228 229 230 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 224 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_short(s = nil)
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.
235 236 237 238 239 240 241 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 235 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_string(str = nil, enc = nil)
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.
281 282 283 284 285 286 287 288 289 290 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 281 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)
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.
191 192 193 194 195 196 197 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 191 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)
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.
213 214 215 216 217 218 219 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 213 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_short(s = nil)
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.
246 247 248 249 250 251 252 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 246 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 |
- (::Vertx::Buffer) copy
442 443 444 445 446 447 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 442 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)
start
and ending at position end - 1
139 140 141 142 143 144 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 139 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)
byte at position pos in the Buffer.
56 57 58 59 60 61 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 56 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)
double at position pos in the Buffer.
101 102 103 104 105 106 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 101 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)
float at position pos in the Buffer.
110 111 112 113 114 115 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 110 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)
int at position pos in the Buffer.
74 75 76 77 78 79 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 74 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_long(pos = nil)
long at position pos in the Buffer.
92 93 94 95 96 97 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 92 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_short(pos = nil)
short at position pos in the Buffer.
119 120 121 122 123 124 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 119 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 |
- (String) get_string(start = nil, _end = nil, enc = nil)
String starting at position start
and ending at position end - 1 interpreted as a String in the specified encoding
151 152 153 154 155 156 157 158 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 151 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)
byte at position pos in the Buffer, as a short.
65 66 67 68 69 70 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 65 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)
int at position pos in the Buffer, as a long.
83 84 85 86 87 88 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 83 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_short(pos = nil)
short at position pos in the Buffer, as an int.
128 129 130 131 132 133 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 128 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) length
434 435 436 437 438 439 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 434 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)
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.
405 406 407 408 409 410 411 412 413 414 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 405 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)
byte at position pos in the Buffer to the value b.The buffer will expand as necessary to accommodate any value written.
296 297 298 299 300 301 302 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 296 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)
double at position pos in the Buffer to the value d.The buffer will expand as necessary to accommodate any value written.
355 356 357 358 359 360 361 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 355 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)
float at position pos in the Buffer to the value f.The buffer will expand as necessary to accommodate any value written.
367 368 369 370 371 372 373 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 367 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)
int at position pos in the Buffer to the value i.The buffer will expand as necessary to accommodate any value written.
319 320 321 322 323 324 325 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 319 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_long(pos = nil, l = nil)
long at position pos in the Buffer to the value l.The buffer will expand as necessary to accommodate any value written.
343 344 345 346 347 348 349 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 343 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_short(pos = nil, s = nil)
short at position pos in the Buffer to the value s.The buffer will expand as necessary to accommodate any value written.
379 380 381 382 383 384 385 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 379 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_string(pos = nil, str = nil, enc = nil)
pos in the Buffer to the value of str encoded in encoding enc.The buffer will expand as necessary to accommodate any value written.
421 422 423 424 425 426 427 428 429 430 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 421 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 |
- (::Vertx::Buffer) set_unsigned_byte(pos = nil, b = nil)
byte at position pos in the Buffer to the value b.The buffer will expand as necessary to accommodate any value written.
308 309 310 311 312 313 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 308 def set_unsigned_byte(pos=nil,b=nil) if pos.class == Fixnum && b.class == Fixnum && !block_given? return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setUnsignedByte, [Java::int.java_class,Java::short.java_class]).call(pos,::Vertx::Util::Utils.to_short(b)),::Vertx::Buffer) end raise ArgumentError, "Invalid arguments when calling set_unsigned_byte(pos,b)" end |
- (self) set_unsigned_int(pos = nil, i = nil)
int at position pos in the Buffer to the value i.The buffer will expand as necessary to accommodate any value written.
331 332 333 334 335 336 337 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 331 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_short(pos = nil, s = nil)
short at position pos in the Buffer to the value s.The buffer will expand as necessary to accommodate any value written.
391 392 393 394 395 396 397 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 391 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 |
- (::Vertx::Buffer) slice(start = nil, _end = nil)
454 455 456 457 458 459 460 461 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 454 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 |
- (String) to_string(enc = nil)
String representation of the Buffer with the encoding specified by enc
47 48 49 50 51 52 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/buffer.rb', line 47 def to_string(enc=nil) if 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 |