Moved EncryptionDataSegmentHeaderRegex from ResponseParser to MessageUtils

This commit is contained in:
dankito 2020-07-05 11:42:16 +02:00
parent d97375d949
commit 3dc8e64127
2 changed files with 3 additions and 3 deletions

View File

@ -28,8 +28,6 @@ open class ResponseParser(
) {
companion object {
val EncryptionDataSegmentHeaderRegex = Regex("${MessageSegmentId.EncryptionData.id}:\\d{1,3}:\\d{1,3}\\+")
val JobParametersSegmentRegex = Regex("HI[A-Z]{3}S")
const val FeedbackParametersSeparator = "; "

View File

@ -8,6 +8,8 @@ open class MessageUtils {
companion object {
val BinaryDataHeaderPattern = Regex("@\\d+@")
val EncryptionDataSegmentHeaderRegex = Regex("${MessageSegmentId.EncryptionData.id}:\\d{1,3}:\\d{1,3}\\+")
}
@ -40,7 +42,7 @@ open class MessageUtils {
if (binaryDataHeaderStartIndex > 15) {
ResponseParser.EncryptionDataSegmentHeaderRegex.find(dataString, binaryDataHeaderStartIndex - 15)?.let { matchResult ->
EncryptionDataSegmentHeaderRegex.find(dataString, binaryDataHeaderStartIndex - 15)?.let { matchResult ->
return matchResult.range.start < binaryDataHeaderStartIndex
}
}