You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/05/23 12:41:12 UTC
[plc4x] branch develop updated: feat(plc4go): expose curstom write buffer
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new 7d0002ac69 feat(plc4go): expose curstom write buffer
7d0002ac69 is described below
commit 7d0002ac698c363bae408c03356fca92b00b5fcd
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Mon May 23 14:41:05 2022 +0200
feat(plc4go): expose curstom write buffer
---
plc4go/utils/exposedUtils.go | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/plc4go/utils/exposedUtils.go b/plc4go/utils/exposedUtils.go
index 00288fc0a0..4f34c89d3e 100644
--- a/plc4go/utils/exposedUtils.go
+++ b/plc4go/utils/exposedUtils.go
@@ -20,6 +20,8 @@
package utils
import (
+ "bytes"
+ "encoding/binary"
"github.com/apache/plc4x/plc4go/internal/spi/utils"
)
@@ -52,3 +54,8 @@ func NewWriteBufferByteBased() WriteBufferByteBased {
func NewLittleEndianWriteBufferByteBased() WriteBufferByteBased {
return utils.NewLittleEndianWriteBufferByteBased()
}
+
+// NewCustomWriteBufferByteBased creates a byte base write buffer with a custom underlying bytes.Buffer
+func NewCustomWriteBufferByteBased(buffer *bytes.Buffer, byteOrder binary.ByteOrder) WriteBufferByteBased {
+ return utils.NewCustomWriteBufferByteBased(buffer, byteOrder)
+}