Back to project page ion.
The source code is released under:
Apache License
If you think the Android project ion listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.koushikdutta.ion; //w w w . j a v a 2 s.c om import com.koushikdutta.async.ByteBufferList; import com.koushikdutta.async.DataEmitter; import com.koushikdutta.async.DataSink; import com.koushikdutta.async.callback.CompletedCallback; import com.koushikdutta.async.future.Future; import com.koushikdutta.async.future.TransformFuture; import com.koushikdutta.async.parser.AsyncParser; import com.koushikdutta.async.parser.ByteBufferListParser; import com.koushikdutta.async.stream.ByteBufferListInputStream; import java.io.InputStream; /** * Created by koush on 11/3/13. */ class InputStreamParser implements AsyncParser<InputStream> { @Override public Future<InputStream> parse(DataEmitter emitter) { return new ByteBufferListParser().parse(emitter) .then(new TransformFuture<InputStream, ByteBufferList>() { @Override protected void transform(ByteBufferList result) throws Exception { setComplete(new ByteBufferListInputStream(result)); } }); } @Override public void write(DataSink sink, InputStream value, CompletedCallback completed) { throw new AssertionError("not implemented"); } }