Constructor and Description |
---|
StringSegment(String message)
Initializes the segment with a message.
|
StringSegment(String message,
Charset charset)
Initializes the segment with a message.
|
StringSegment(String message,
String charsetName)
Initializes the segment with a message.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes()
Returns the segment text as a byte array (partial message).
|
String |
getCharsetName() |
String |
getMessage() |
public StringSegment(String message)
message
- the text for the segmentpublic StringSegment(String message, Charset charset)
message
- the text for the segmentcharset
- the charset to use for encoding the string to a byte arraypublic StringSegment(String message, String charsetName) throws UnsupportedEncodingException
message
- the text for the segmentcharsetName
- the charset name to use for encoding the string to a byte
arrayUnsupportedEncodingException
- when the charset could not be foundpublic byte[] getBytes()
Segment
public String getMessage()
public String getCharsetName()
Copyright © 2021. All rights reserved.