@Override public LazyBodyReader toBodyReader() { try { return new LazyBodyReader( new FramedBody.ContentLength(getBodyDecoder(), file.length()), new BufferedInputStream(Files.newInputStream(file.toPath()))); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public LazyBodyReader toBodyReader() { try { return new LazyBodyReader( new FramedBody.ContentLength(getBodyDecoder(), file.length()), new BufferedInputStream(Files.newInputStream(file.toPath()))); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public LazyBodyReader toBodyReader() { return new LazyBodyReader( new FramedBody.ContentLength(getBodyDecoder(), (long) bytes.length), new ByteArrayInputStream(bytes)); }
throw new InvalidMessageFrame("Content-Length header value is not a valid number"); return new FramedBody.ContentLength(bodyDecoder, bodyLength);
throw new InvalidMessageFrame("Content-Length header value is not a valid number"); return new FramedBody.ContentLength(bodyDecoder, bodyLength);
@Override public LazyBodyReader toBodyReader() { return new LazyBodyReader( new FramedBody.ContentLength(getBodyDecoder(), (long) bytes.length), new ByteArrayInputStream(bytes)); }
/** * Create an instance of this class from the given bytes. * <p> * The bytes are assumed to be the decoded HTTP message's body. * * @param bytes plain HTTP message's body */ public EagerBodyReader(byte[] bytes) { super(new FramedBody.ContentLength(bytes.length)); this.rawInputStream = null; this.rawBytes = bytes; }
/** * Create an instance of this class from the given bytes. * <p> * The bytes are assumed to be the decoded HTTP message's body. * * @param bytes plain HTTP message's body */ public EagerBodyReader(byte[] bytes) { super(new FramedBody.ContentLength(bytes.length)); this.rawInputStream = null; this.rawBytes = bytes; }