diff --git a/src/dorkbox/network/serialization/AeronInput.java b/src/dorkbox/network/serialization/AeronInput.java index 88b074a7..4fd5e751 100644 --- a/src/dorkbox/network/serialization/AeronInput.java +++ b/src/dorkbox/network/serialization/AeronInput.java @@ -147,7 +147,14 @@ class AeronInput extends Input { } /** - * Throws {@link UnsupportedOperationException} because this input uses a ByteBuffer, not a byte[]. + * Sets the internal buffer (and properties based on that buffer) + */ + public void setBuffer(DirectBuffer buffer) { + setBuffer(buffer, 0, buffer.capacity()); + } + + /** + * Sets the internal buffer (and properties based on that buffer) */ public void setBuffer (DirectBuffer buffer, int offset, int length) { this.internalBuffer = buffer; diff --git a/src/dorkbox/network/serialization/AeronOutput.java b/src/dorkbox/network/serialization/AeronOutput.java index c156f51a..179e8af7 100644 --- a/src/dorkbox/network/serialization/AeronOutput.java +++ b/src/dorkbox/network/serialization/AeronOutput.java @@ -123,6 +123,15 @@ public class AeronOutput extends Output { throw new UnsupportedOperationException("This buffer does not used a byte[], see #getInternaleBuffer()."); } + /** + * Sets a new buffer to write to. The max size is the buffer's length. + */ + public void setBuffer (MutableDirectBuffer buffer) { + internalBuffer = buffer; + position = 0; + capacity = buffer.capacity(); + } + /** * Sets a new buffer to write to. The max size is the buffer's length. */