class InputStreamBody implements Body {

        private final InputStream inputStream;
        private final long contentLength;
        private byte[] chunk;

        private InputStreamBody(InputStream inputStream, long contentLength) {
            this.inputStream = inputStream;
            this.contentLength = contentLength;
        }

        @Override
        public long getContentLength() {
            return contentLength;
        }

        @Override
        public BodyState transferTo(ByteBuf target) {<FILL_FUNCTION_BODY>}

        @Override
        public void close() throws IOException {
            inputStream.close();
        }
    }


            // To be safe.
            chunk = new byte[target.writableBytes() - 10];

            int read = -1;
            boolean write = false;
            try {
                read = inputStream.read(chunk);
            } catch (IOException ex) {
                LOGGER.warn("Unable to read", ex);
            }

            if (read > 0) {
                target.writeBytes(chunk, 0, read);
                write = true;
            }
            return write ? BodyState.CONTINUE : BodyState.STOP;
        
<no_super_class>