### Question:
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);  }### Answer:
@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()); } } }
@Test public void transferZeroCopy() throws Exception { for (int bufferLength = 1; bufferLength < MAX_MULTIPART_CONTENT_LENGTH_ESTIMATE + 1; bufferLength++) { try (MultipartBody multipartBody = buildMultipart()) { long tranferred = transferZeroCopy(multipartBody, bufferLength); assertEquals(tranferred, multipartBody.getContentLength()); } } }