From d748ca1bde4cb35cfba6b29e3815dd7ed25b175f Mon Sep 17 00:00:00 2001 From: redkale Date: Sat, 16 Sep 2023 22:41:56 +0800 Subject: [PATCH] write --- .../java/org/redkale/net/AsyncConnection.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/redkale/net/AsyncConnection.java b/src/main/java/org/redkale/net/AsyncConnection.java index 275bd1b0f..156c5fe95 100644 --- a/src/main/java/org/redkale/net/AsyncConnection.java +++ b/src/main/java/org/redkale/net/AsyncConnection.java @@ -13,8 +13,8 @@ import java.util.*; import java.util.concurrent.atomic.LongAdder; import java.util.concurrent.locks.ReentrantLock; import java.util.function.*; -import javax.net.ssl.SSLEngineResult.HandshakeStatus; import javax.net.ssl.*; +import javax.net.ssl.SSLEngineResult.HandshakeStatus; import static javax.net.ssl.SSLEngineResult.HandshakeStatus.*; import static javax.net.ssl.SSLEngineResult.Status.*; import org.redkale.util.*; @@ -356,19 +356,23 @@ public abstract class AsyncConnection implements Channel, AutoCloseable { } public final void write(byte[] bytes, CompletionHandler handler) { - write(bytes, 0, bytes.length, null, 0, 0, handler); + write(bytes, 0, bytes.length, (byte[]) null, 0, 0, handler); } - public final void write(ByteTuple array, CompletionHandler handler) { - write(array.content(), array.offset(), array.length(), null, 0, 0, handler); - } - - public final void write(ByteTuple array, A attachment, CompletionHandler handler) { - write(array.content(), array.offset(), array.length(), null, 0, 0, attachment, handler); + public final void write(byte[] bytes, A attachment, CompletionHandler handler) { + write(bytes, 0, bytes.length, (byte[]) null, 0, 0, attachment, handler); } public final void write(byte[] bytes, int offset, int length, CompletionHandler handler) { - write(bytes, offset, length, null, 0, 0, handler); + write(bytes, offset, length, (byte[]) null, 0, 0, handler); + } + + public final void write(ByteTuple array, CompletionHandler handler) { + write(array.content(), array.offset(), array.length(), (byte[]) null, 0, 0, handler); + } + + public final void write(ByteTuple array, A attachment, CompletionHandler handler) { + write(array.content(), array.offset(), array.length(), (byte[]) null, 0, 0, attachment, handler); } public final void write(ByteTuple header, ByteTuple body, CompletionHandler handler) {