return ByteBuffer.wrap(b.get(), 0, b.length());
} else if (body instanceof File) {
// serving file is better be done by Nginx
return readAll((File) body);
} else if (body instanceof Seqable) {
ISeq seq = ((Seqable) body).seq();
DynamicBytes b = new DynamicBytes(seq.count() * 512);
while (seq != null) {
b.append(seq.first().toString(), UTF_8);
seq = seq.next();
}
return ByteBuffer.wrap(b.get(), 0, b.length());
// makes ultimate optimization possible: no copy
} else if (body instanceof ByteBuffer) {
return (ByteBuffer) body;