@Test void testCopy() throws Exception { final ByteArrayInputStream input = new ByteArrayInputStream("I'LL BE COPIED".getBytes(Charset.defaultCharset())); final ObjIntConsumer<byte[]> consumer = (bytes, length) -> { assertThat(length, equalTo(14)); assertThat(new String(Arrays.copyOf(bytes, 14), Charset.defaultCharset()), equalTo("I'LL BE COPIED")); }; PodUpload.copy(input, consumer); }
static void copy(InputStream inputStream, ObjIntConsumer<byte[]> consumer) throws IOException { final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; int n; while (-1 != (n = inputStream.read(buffer))) { consumer.accept(buffer, n); } }
PodUpload { static void copy(InputStream inputStream, ObjIntConsumer<byte[]> consumer) throws IOException { final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; int n; while (-1 != (n = inputStream.read(buffer))) { consumer.accept(buffer, n); } } }
PodUpload { static void copy(InputStream inputStream, ObjIntConsumer<byte[]> consumer) throws IOException { final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; int n; while (-1 != (n = inputStream.read(buffer))) { consumer.accept(buffer, n); } } private  PodUpload(); }
PodUpload { static void copy(InputStream inputStream, ObjIntConsumer<byte[]> consumer) throws IOException { final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; int n; while (-1 != (n = inputStream.read(buffer))) { consumer.accept(buffer, n); } } private  PodUpload(); static boolean upload(OkHttpClient client, PodOperationContext context,
    OperationSupport operationSupport, Path pathToUpload); }
PodUpload { static void copy(InputStream inputStream, ObjIntConsumer<byte[]> consumer) throws IOException { final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; int n; while (-1 != (n = inputStream.read(buffer))) { consumer.accept(buffer, n); } } private  PodUpload(); static boolean upload(OkHttpClient client, PodOperationContext context,
    OperationSupport operationSupport, Path pathToUpload);  }