@Test public void transferWithCopy() throws Exception { for (int bufferLength = 1; bufferLength < MAX_MULTIPART_CONTENT_LENGTH_ESTIMATE + 1; bufferLength++) { try (MultipartBody multipartBody = buildMultipart()) { long tranferred = transferWithCopy(multipartBody, bufferLength); assertEquals(tranferred, multipartBody.getContentLength()); } } }
public long getContentLength() { return contentLength; }
MultipartBody implements RandomAccessBody { public long getContentLength() { return contentLength; } }
MultipartBody implements RandomAccessBody { public long getContentLength() { return contentLength; } MultipartBody(List<MultipartPart<? extends Part>> parts, String contentType, byte[] boundary); }
MultipartBody implements RandomAccessBody { public long getContentLength() { return contentLength; } MultipartBody(List<MultipartPart<? extends Part>> parts, String contentType, byte[] boundary); void close(); long getContentLength(); String getContentType(); byte[] getBoundary(); BodyState transferTo(ByteBuf target); @Override long transferTo(WritableByteChannel target); }
MultipartBody implements RandomAccessBody { public long getContentLength() { return contentLength; } MultipartBody(List<MultipartPart<? extends Part>> parts, String contentType, byte[] boundary); void close(); long getContentLength(); String getContentType(); byte[] getBoundary(); BodyState transferTo(ByteBuf target); @Override long transferTo(WritableByteChannel target);  }