Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bcs/serializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@ func SerializeBytes(input []byte) ([]byte, error) {
})
}

// SerializeString serializes a single string using the BCS format
func SerializeString(input string) ([]byte, error) {
return SerializeSingle(func(ser *Serializer) {
ser.WriteString(input)
})
}

// SerializeSingle is a convenience function, to not have to create a serializer to serialize one value
//
// Here's an example for handling a nested byte array
Expand Down
Loading