Modifier and Type | Method and Description |
---|---|
byte[] |
bytes()
HTTP body as byte array.
|
ReadableByteChannel |
channel()
Body as readable channel.
|
static Body |
empty()
Empty body.
|
long |
getSize()
Size in bytes.
|
boolean |
isInMemory()
True if body is on memory.
|
static Body |
of(byte[] bytes)
Creates a HTTP body from byte array.
|
static Body |
of(InputStream stream,
long size)
Creates a HTTP body from input stream.
|
static Body |
of(Path file)
Creates a HTTP body from file.
|
InputStream |
stream()
Body as input stream.
|
default String |
value(Charset charset)
HTTP body as string.
|
array, booleanValue, booleanValue, byteValue, byteValue, create, create, doubleValue, doubleValue, fileUpload, floatValue, floatValue, get, get, hash, intValue, intValue, isArray, isMissing, isObject, isSingle, isUpload, iterator, longValue, longValue, missing, name, resolve, resolve, resolve, resolve, size, to, to, to, toEnum, toEnum, toList, toList, toMap, toMultimap, toOptional, toOptional, toSet, toSet, value, value, value, value, valueOrNull
forEach, spliterator
@Nonnull default String value(@Nonnull Charset charset)
charset
- Charset.@Nonnull byte[] bytes()
boolean isInMemory()
ServerOptions.getMaxRequestSize()
will be dump to disk.long getSize()
Content-Length
header.Content-Length
header.@Nonnull ReadableByteChannel channel()
@Nonnull InputStream stream()
static Body empty()
@Nonnull static Body of(@Nonnull InputStream stream, long size)
stream
- Input stream.size
- Size in bytes or -1
.@Nonnull static Body of(@Nonnull byte[] bytes)
bytes
- byte array.Copyright © 2019. All rights reserved.