use of org.jocean.netty.BlobRepo.Blob in project jocean-http by isdom.
the class AsBlob method onNext4Multipart.
private Observable<? extends Blob> onNext4Multipart(final HttpContent content) {
try {
_postDecoder.offer(content);
} catch (ErrorDataDecoderException e) {
LOG.warn("exception when postDecoder.offer, detail: {}", ExceptionUtils.exception2detail(e));
}
final List<Blob> blobs = new ArrayList<>();
try {
while (_postDecoder.hasNext()) {
final InterfaceHttpData data = _postDecoder.next();
if (data != null) {
try {
final Blob blob = this._holder.hold(processHttpData(data));
if (null != blob) {
blobs.add(blob);
LOG.info("onNext4Multipart: add Blob {}", blob);
}
} finally {
data.release();
}
}
}
} catch (EndOfDataDecoderException e) {
LOG.warn("exception when postDecoder.hasNext, detail: {}", ExceptionUtils.exception2detail(e));
}
return blobs.isEmpty() ? Observable.<Blob>empty() : Observable.from(blobs);
}
Aggregations