Added setBuffer(DirectBuffer) method
This commit is contained in:
parent
bb2a7d8c41
commit
a8a6a517f7
|
@ -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) {
|
public void setBuffer (DirectBuffer buffer, int offset, int length) {
|
||||||
this.internalBuffer = buffer;
|
this.internalBuffer = buffer;
|
||||||
|
|
|
@ -123,6 +123,15 @@ public class AeronOutput extends Output {
|
||||||
throw new UnsupportedOperationException("This buffer does not used a byte[], see #getInternaleBuffer().");
|
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.
|
* Sets a new buffer to write to. The max size is the buffer's length.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user