Class List Method List File List

# Class: Vertx::AsyncFile

Inherits:
  Object
  - Object
  - Vertx::AsyncFile
  show all
Includes:
  ReadStream, WriteStream
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb

## Instance Method Summary (collapse)

- - (Object) close
- - (Object) drain_handler
- - (Object) end(t = nil)
- - (Object) end_handler
- - (Object) exception_handler
- - (Object) flush
- - (Object) handler
- - (AsyncFile) initialize(j_del) constructor
  A new instance of AsyncFile.
- - (Object) j_del
- - (Object) pause
- - (Object) read(buffer = nil, offset = nil, position = nil, length = nil)
- - (Object) resume
- - (Object) set_read_buffer_size(readBufferSize = nil)
- - (Object) set_read_pos(readPos = nil)
- - (Object) set_write_pos(writePos = nil)
- - (Object) set_write_queue_max_size(maxSize = nil)
- - (Object) write(buffer = nil, position = nil)
- - (Boolean) write_queue_full?

## Constructor Details

### - (`AsyncFile`) initialize(j_del)

Returns a new instance of AsyncFile

    18
    19
    20
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 18

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) close

Raises:

- (`ArgumentError`)

    133
    134
    135
    136
    137
    138
    139
    140
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 133

    def close
      if !block_given?
        return @j_del.java_method(:close, []).call()
      elsif block_given?
        return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling close()"
    end

### - (`Object`) drain_handler

Raises:

- (`ArgumentError`)

    113
    114
    115
    116
    117
    118
    119
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 113

    def drain_handler
      if block_given?
        @j_del.java_method(:drainHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
        return self
      end
      raise ArgumentError, "Invalid arguments when calling drain_handler()"
    end

### - (`Object`) end(t = nil)

Raises:

- (`ArgumentError`)

    29
    30
    31
    32
    33
    34
    35
    36
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 29

    def end(t=nil)
      if !block_given? && t == nil
        return @j_del.java_method(:end, []).call()
      elsif t.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:end, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(t.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling end(t)"
    end

### - (`Object`) end_handler

Raises:

- (`ArgumentError`)

    72
    73
    74
    75
    76
    77
    78
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 72

    def end_handler
      if block_given?
        @j_del.java_method(:endHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
        return self
      end
      raise ArgumentError, "Invalid arguments when calling end_handler()"
    end

### - (`Object`) exception_handler

Raises:

- (`ArgumentError`)

    122
    123
    124
    125
    126
    127
    128
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 122

    def exception_handler
      if block_given?
        @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling exception_handler()"
    end

### - (`Object`) flush

Raises:

- (`ArgumentError`)

    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 165

    def flush
      if !block_given?
        @j_del.java_method(:flush, []).call()
        return self
      elsif block_given?
        @j_del.java_method(:flush, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling flush()"
    end

### - (`Object`) handler

Raises:

- (`ArgumentError`)

    47
    48
    49
    50
    51
    52
    53
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 47

    def handler
      if block_given?
        @j_del.java_method(:handler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::Vertx::Buffer)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling handler()"
    end

### - (`Object`) j_del

    23
    24
    25
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 23

    def j_del
      @j_del
    end

### - (`Object`) pause

Raises:

- (`ArgumentError`)

    55
    56
    57
    58
    59
    60
    61
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 55

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

### - (`Object`) read(buffer = nil, offset = nil, position = nil, length = nil)

Raises:

- (`ArgumentError`)

    155
    156
    157
    158
    159
    160
    161
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 155

    def read(buffer=nil,offset=nil,position=nil,length=nil)
      if buffer.class.method_defined?(:j_del) && offset.class == Fixnum && position.class == Fixnum && length.class == Fixnum && block_given?
        @j_del.java_method(:read, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::int.java_class,Java::long.java_class,Java::int.java_class,Java::IoVertxCore::Handler.java_class]).call(buffer.j_del,offset,position,length,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::Buffer) : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling read(buffer,offset,position,length)"
    end

### - (`Object`) resume

Raises:

- (`ArgumentError`)

    63
    64
    65
    66
    67
    68
    69
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 63

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

### - (`Object`) set_read_buffer_size(readBufferSize = nil)

Raises:

- (`ArgumentError`)

    199
    200
    201
    202
    203
    204
    205
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 199

    def set_read_buffer_size(readBufferSize=nil)
      if readBufferSize.class == Fixnum && !block_given?
        @j_del.java_method(:setReadBufferSize, [Java::int.java_class]).call(readBufferSize)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_read_buffer_size(readBufferSize)"
    end

### - (`Object`) set_read_pos(readPos = nil)

Raises:

- (`ArgumentError`)

    178
    179
    180
    181
    182
    183
    184
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 178

    def set_read_pos(readPos=nil)
      if readPos.class == Fixnum && !block_given?
        @j_del.java_method(:setReadPos, [Java::long.java_class]).call(readPos)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_read_pos(readPos)"
    end

### - (`Object`) set_write_pos(writePos = nil)

Raises:

- (`ArgumentError`)

    188
    189
    190
    191
    192
    193
    194
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 188

    def set_write_pos(writePos=nil)
      if writePos.class == Fixnum && !block_given?
        @j_del.java_method(:setWritePos, [Java::long.java_class]).call(writePos)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_write_pos(writePos)"
    end

### - (`Object`) set_write_queue_max_size(maxSize = nil)

Raises:

- (`ArgumentError`)

    104
    105
    106
    107
    108
    109
    110
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 104

    def set_write_queue_max_size(maxSize=nil)
      if maxSize.class == Fixnum && !block_given?
        @j_del.java_method(:setWriteQueueMaxSize, [Java::int.java_class]).call(maxSize)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_write_queue_max_size(maxSize)"
    end

### - (`Object`) write(buffer = nil, position = nil)

Raises:

- (`ArgumentError`)

    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 92

    def write(buffer=nil,position=nil)
      if buffer.class.method_defined?(:j_del) && !block_given? && position == nil
        @j_del.java_method(:write, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(buffer.j_del)
        return self
      elsif buffer.class.method_defined?(:j_del) && position.class == Fixnum && block_given?
        @j_del.java_method(:write, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(buffer.j_del,position,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling write(buffer,position)"
    end

### - (`Boolean`) write_queue_full?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    39
    40
    41
    42
    43
    44
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/async_file.rb', line 39

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