@@ -12,15 +12,9 @@ import aws.smithy.kotlin.runtime.text.encoding.encodeToHex
1212
1313internal const val MESSAGE_CRC_BYTE_LEN = 4
1414
15- // max message size is 16 MB
16- internal const val MAX_MESSAGE_SIZE = 16 * 1024 * 1024
17-
18- // max header size is 128 KB
19- internal const val MAX_HEADER_SIZE = 128 * 1024
20-
2115/*
2216 Message Wire Format
23- See also: https://docs.aws.amazon.com/transcribe/latest/dg/event-stream-med .html
17+ See also: https://docs.aws.amazon.com/transcribe/latest/dg/streaming-setting-up .html
2418
2519 +--------------------------------------------------------------------+ --
2620 | Total Len (32) | |
@@ -49,7 +43,6 @@ public data class Message(val headers: List<Header>, val payload: ByteArray) {
4943 */
5044 public fun decode (source : SdkBufferedSource ): Message {
5145 val totalLen = source.peek().use { it.readInt().toUInt() }
52- check(totalLen <= MAX_MESSAGE_SIZE .toUInt()) { " Invalid Message size: $totalLen " }
5346
5447 // Limiting the amount of data read by SdkBufferedSource is tricky and cause incorrect CRC
5548 // if not careful (e.g. creating a buffered source of a HashingSource will usually lead to incorrect results
@@ -117,8 +110,6 @@ public data class Message(val headers: List<Header>, val payload: ByteArray) {
117110 val payloadLen = payload.size
118111
119112 val messageLen = PRELUDE_BYTE_LEN_WITH_CRC + headersLen + payloadLen + MESSAGE_CRC_BYTE_LEN
120- check(headersLen < MAX_HEADER_SIZE ) { " Invalid Headers length: $headersLen " }
121- check(messageLen < MAX_MESSAGE_SIZE ) { " Invalid Message length: $messageLen " }
122113
123114 val prelude = Prelude (messageLen.toInt(), headersLen.toInt())
124115
0 commit comments