originalContentLength = getContentLength(request); } catch (IOException e) { throw new SdkClientException(
originalContentLength = getContentLength(request); } catch (IOException e) { throw new AmazonClientException(
@Test public void testGetContentLength() throws IOException { final long len = 5 * Constants.MB; final Request<?> request = new DefaultRequest<Void>("service"); final InputStream is = new MockInputStream(len, true); request.setContent(is); assertTrue("same length", len == AWSS3V4Signer.getContentLength(request)); assertTrue("works fine after reset", len == AWSS3V4Signer.getContentLength(request)); is.close(); }
public void testGetContentLengthMarkNotSupported() throws IOException { final Request<?> request = new DefaultRequest<Void>("service"); // Content doesn't support mark request.setContent(new MockInputStream(16, false)); // Should throw exception as mark not supported AWSS3V4Signer.getContentLength(request); }
originalContentLength = getContentLength(request); } catch (IOException e) { throw new SdkClientException(
originalContentLength = getContentLength(request); } catch (IOException e) { throw new AmazonClientException(