2828import org .junit .jupiter .api .BeforeEach ;
2929import org .junit .jupiter .api .Test ;
3030
31- class SdkLengthAwareInputStreamTest {
31+ class LengthAwareInputStreamTest {
3232 private InputStream delegateStream ;
3333
3434 @ BeforeEach
@@ -40,7 +40,7 @@ void setup() {
4040 void read_lengthIs0_returnsEof () throws IOException {
4141 when (delegateStream .available ()).thenReturn (Integer .MAX_VALUE );
4242
43- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegateStream , 0 );
43+ LengthAwareInputStream is = new LengthAwareInputStream (delegateStream , 0 );
4444
4545 assertThat (is .read ()).isEqualTo (-1 );
4646 assertThat (is .read (new byte [16 ], 0 , 16 )).isEqualTo (-1 );
@@ -51,7 +51,7 @@ void read_lengthNonZero_delegateEof_returnsEof() throws IOException {
5151 when (delegateStream .read ()).thenReturn (-1 );
5252 when (delegateStream .read (any (byte [].class ), any (int .class ), any (int .class ))).thenReturn (-1 );
5353
54- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegateStream , 0 );
54+ LengthAwareInputStream is = new LengthAwareInputStream (delegateStream , 0 );
5555
5656 assertThat (is .read ()).isEqualTo (-1 );
5757 assertThat (is .read (new byte [16 ], 0 , 16 )).isEqualTo (-1 );
@@ -61,7 +61,7 @@ void read_lengthNonZero_delegateEof_returnsEof() throws IOException {
6161 void readByte_lengthNonZero_delegateHasAvailable_returnsDelegateData () throws IOException {
6262 when (delegateStream .read ()).thenReturn (42 );
6363
64- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegateStream , 16 );
64+ LengthAwareInputStream is = new LengthAwareInputStream (delegateStream , 16 );
6565
6666 assertThat (is .read ()).isEqualTo (42 );
6767 }
@@ -70,7 +70,7 @@ void readByte_lengthNonZero_delegateHasAvailable_returnsDelegateData() throws IO
7070 void readArray_lengthNonZero_delegateHasAvailable_returnsDelegateData () throws IOException {
7171 when (delegateStream .read (any (byte [].class ), any (int .class ), any (int .class ))).thenReturn (8 );
7272
73- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegateStream , 16 );
73+ LengthAwareInputStream is = new LengthAwareInputStream (delegateStream , 16 );
7474
7575 assertThat (is .read (new byte [16 ], 0 , 16 )).isEqualTo (8 );
7676 }
@@ -79,7 +79,7 @@ void readArray_lengthNonZero_delegateHasAvailable_returnsDelegateData() throws I
7979 void readArray_lengthNonZero_propagatesCallToDelegate () throws IOException {
8080 when (delegateStream .read (any (byte [].class ), any (int .class ), any (int .class ))).thenReturn (8 );
8181
82- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegateStream , 16 );
82+ LengthAwareInputStream is = new LengthAwareInputStream (delegateStream , 16 );
8383 byte [] buff = new byte [16 ];
8484 is .read (buff , 0 , 16 );
8585
@@ -90,7 +90,7 @@ void readArray_lengthNonZero_propagatesCallToDelegate() throws IOException {
9090 void read_markAndReset_availableReflectsNewLength () throws IOException {
9191 delegateStream = new ByteArrayInputStream (new byte [32 ]);
9292
93- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegateStream , 16 );
93+ LengthAwareInputStream is = new LengthAwareInputStream (delegateStream , 16 );
9494
9595 for (int i = 0 ; i < 4 ; ++i ) {
9696 is .read ();
@@ -113,7 +113,7 @@ void read_markAndReset_availableReflectsNewLength() throws IOException {
113113 void skip_markAndReset_availableReflectsNewLength () throws IOException {
114114 delegateStream = new ByteArrayInputStream (new byte [32 ]);
115115
116- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegateStream , 16 );
116+ LengthAwareInputStream is = new LengthAwareInputStream (delegateStream , 16 );
117117
118118 is .skip (4 );
119119
@@ -141,7 +141,7 @@ void skip_delegateSkipsLessThanRequested_availableUpdatedCorrectly() throws IOEx
141141
142142 when (delegateStream .read (any (byte [].class ), any (int .class ), any (int .class ))).thenReturn (1 );
143143
144- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegateStream , 16 );
144+ LengthAwareInputStream is = new LengthAwareInputStream (delegateStream , 16 );
145145
146146 long skipped = is .skip (4 );
147147
@@ -156,7 +156,7 @@ void readArray_delegateReadsLessThanRequested_availableUpdatedCorrectly() throws
156156 return n / 2 ;
157157 });
158158
159- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegateStream , 16 );
159+ LengthAwareInputStream is = new LengthAwareInputStream (delegateStream , 16 );
160160
161161 long read = is .read (new byte [16 ], 0 , 8 );
162162
@@ -169,7 +169,7 @@ void readArray_delegateShorterThanExpected_throws() {
169169 int delegateLength = 16 ;
170170 ByteArrayInputStream delegate = new ByteArrayInputStream (new byte [delegateLength ]);
171171
172- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegate , delegateLength + 1 );
172+ LengthAwareInputStream is = new LengthAwareInputStream (delegate , delegateLength + 1 );
173173
174174 assertThatThrownBy (() -> {
175175 int read ;
@@ -186,7 +186,7 @@ void readArray_readExactLength_doesNotThrow() throws IOException {
186186 int delegateLength = 16 ;
187187 ByteArrayInputStream delegate = new ByteArrayInputStream (new byte [delegateLength ]);
188188
189- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegate , delegateLength );
189+ LengthAwareInputStream is = new LengthAwareInputStream (delegate , delegateLength );
190190
191191 int total = 0 ;
192192 int read ;
@@ -204,7 +204,7 @@ void readArray_delegateLongerThanRequired_truncated() throws IOException {
204204 int length = 16 ;
205205 ByteArrayInputStream delegate = new ByteArrayInputStream (new byte [delegateLength ]);
206206
207- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegate , length );
207+ LengthAwareInputStream is = new LengthAwareInputStream (delegate , length );
208208
209209 int total = 0 ;
210210 int read ;
@@ -221,7 +221,7 @@ void readByte_delegateShorterThanExpected_throws() {
221221 int delegateLength = 16 ;
222222 ByteArrayInputStream delegate = new ByteArrayInputStream (new byte [delegateLength ]);
223223
224- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegate , delegateLength + 1 );
224+ LengthAwareInputStream is = new LengthAwareInputStream (delegate , delegateLength + 1 );
225225
226226 assertThatThrownBy (() -> {
227227 int read ;
@@ -237,7 +237,7 @@ void readByte_readExactLength_doesNotThrow() throws IOException {
237237 int delegateLength = 16 ;
238238 ByteArrayInputStream delegate = new ByteArrayInputStream (new byte [delegateLength ]);
239239
240- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegate , delegateLength );
240+ LengthAwareInputStream is = new LengthAwareInputStream (delegate , delegateLength );
241241
242242 int total = 0 ;
243243 while (total != delegateLength && is .read () != -1 ) {
@@ -253,7 +253,7 @@ void readBytePartialThenMark_doesNotResetContentLength() throws IOException {
253253 int expectedContentLength = delegateLength + 1 ;
254254 ByteArrayInputStream delegate = new ByteArrayInputStream (new byte [delegateLength ]);
255255
256- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegate , expectedContentLength );
256+ LengthAwareInputStream is = new LengthAwareInputStream (delegate , expectedContentLength );
257257 is .read (); // read one byte
258258 is .mark (1024 );
259259 // read another byte and reset, the length should not be reset based on the byte that was already read
@@ -274,7 +274,7 @@ void readByte_delegateLongerThanRequired_truncated() throws IOException {
274274 int length = 16 ;
275275 ByteArrayInputStream delegate = new ByteArrayInputStream (new byte [delegateLength ]);
276276
277- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegate , length );
277+ LengthAwareInputStream is = new LengthAwareInputStream (delegate , length );
278278
279279 int total = 0 ;
280280 while (total != delegateLength && is .read () != -1 ) {
@@ -290,7 +290,7 @@ public void skip_thenReadByteUntilEof_doesNotThrowLengthMismatch() throws IOExce
290290
291291 ByteArrayInputStream delegate = new ByteArrayInputStream (new byte [delegateLength ]);
292292
293- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegate , delegateLength );
293+ LengthAwareInputStream is = new LengthAwareInputStream (delegate , delegateLength );
294294
295295 int bytesToSkip = 8 ;
296296 int skippedBytes = 0 ;
@@ -315,7 +315,7 @@ public void skip_thenReadArrayUntilEof_doesNotThrowLengthMismatch() throws IOExc
315315
316316 ByteArrayInputStream delegate = new ByteArrayInputStream (new byte [delegateLength ]);
317317
318- SdkLengthAwareInputStream is = new SdkLengthAwareInputStream (delegate , delegateLength );
318+ LengthAwareInputStream is = new LengthAwareInputStream (delegate , delegateLength );
319319
320320 int bytesToSkip = 8 ;
321321 int skippedBytes = 0 ;
0 commit comments