/** * Write a {@link io.vertx.rxjava.core.buffer.Buffer} to the file at position <code>position</code> in the file, asynchronously. * <p> * If <code>position</code> lies outside of the current size * of the file, the file will be enlarged to encompass it. * <p> * When multiple writes are invoked on the same file * there are no guarantees as to order in which those writes actually occur * <p> * The handler will be called when the write is complete, or if an error occurs. * @param buffer the buffer to write * @param position the position in the file to write it at * @return a reference to this, so the API can be used fluently * @deprecated use {@link #rxWrite} instead */ @Deprecated() public Observable<Void> writeObservable(io.vertx.rxjava.core.buffer.Buffer buffer, long position) { io.vertx.rx.java.ObservableFuture<Void> handler = io.vertx.rx.java.RxHelper.observableFuture(); write(buffer, position, handler.toHandler()); return handler; }
/** * Write a {@link io.vertx.rxjava.core.buffer.Buffer} to the file at position <code>position</code> in the file, asynchronously. * <p> * If <code>position</code> lies outside of the current size * of the file, the file will be enlarged to encompass it. * <p> * When multiple writes are invoked on the same file * there are no guarantees as to order in which those writes actually occur * <p> * The handler will be called when the write is complete, or if an error occurs. * @param buffer the buffer to write * @param position the position in the file to write it at * @return a reference to this, so the API can be used fluently */ public Single<Void> rxWrite(io.vertx.rxjava.core.buffer.Buffer buffer, long position) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { write(buffer, position, fut); })); }
/** * Write a {@link io.vertx.rxjava.core.buffer.Buffer} to the file at position <code>position</code> in the file, asynchronously. * <p> * If <code>position</code> lies outside of the current size * of the file, the file will be enlarged to encompass it. * <p> * When multiple writes are invoked on the same file * there are no guarantees as to order in which those writes actually occur * <p> * The handler will be called when the write is complete, or if an error occurs. * @param buffer the buffer to write * @param position the position in the file to write it at * @return a reference to this, so the API can be used fluently */ public Single<Void> rxWrite(io.vertx.rxjava.core.buffer.Buffer buffer, long position) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { write(buffer, position, fut); })); }
lastOutput[0] = read[0]; dest.write(buf); });