@Test public void bufToString() throws Exception { String result = Observable.merge( obs("foo".getBytes(StandardCharsets.UTF_8)), obs("bar".getBytes(StandardCharsets.UTF_8)), obs("baz".getBytes(StandardCharsets.UTF_8))) .compose(ByteBufs.toString("UTF-8")) .toBlocking() .first(); Assert.assertEquals("foobarbaz", result); }
public static Observable.Transformer<ByteBuf, String> toString(String enc) { return input -> input.compose(aggrByteArray()).map(buf -> newString(buf, enc)); }
ByteBufs { public static Observable.Transformer<ByteBuf, String> toString(String enc) { return input -> input.compose(aggrByteArray()).map(buf -> newString(buf, enc)); } }
ByteBufs { public static Observable.Transformer<ByteBuf, String> toString(String enc) { return input -> input.compose(aggrByteArray()).map(buf -> newString(buf, enc)); } private  ByteBufs(); }
ByteBufs { public static Observable.Transformer<ByteBuf, String> toString(String enc) { return input -> input.compose(aggrByteArray()).map(buf -> newString(buf, enc)); } private  ByteBufs(); static Observable.Transformer<ByteBuf, ByteBuf> gzip(); static Observable.Transformer<ByteBuf, ByteBuf> gunzip(); static Observable.Transformer<ByteBuf, ByteBuf> json(); static Observable.Transformer<ByteBuf, ByteBuf> json(int maxLength); static Observable<ByteBuf> autoReleaseCopy(Observable<ByteBuf> stream); static Observable.Transformer<ByteBuf, ByteBuf> lines(int maxLength); static Observable.Transformer<ByteBuf, ServerSentEvent> sse(int maxLength); static Func1<ByteBuf, byte[]> toByteArray(); static Observable.Transformer<ByteBuf, byte[]> aggrByteArray(); static Observable.Transformer<ByteBuf, String> toString(String enc); }
ByteBufs { public static Observable.Transformer<ByteBuf, String> toString(String enc) { return input -> input.compose(aggrByteArray()).map(buf -> newString(buf, enc)); } private  ByteBufs(); static Observable.Transformer<ByteBuf, ByteBuf> gzip(); static Observable.Transformer<ByteBuf, ByteBuf> gunzip(); static Observable.Transformer<ByteBuf, ByteBuf> json(); static Observable.Transformer<ByteBuf, ByteBuf> json(int maxLength); static Observable<ByteBuf> autoReleaseCopy(Observable<ByteBuf> stream); static Observable.Transformer<ByteBuf, ByteBuf> lines(int maxLength); static Observable.Transformer<ByteBuf, ServerSentEvent> sse(int maxLength); static Func1<ByteBuf, byte[]> toByteArray(); static Observable.Transformer<ByteBuf, byte[]> aggrByteArray(); static Observable.Transformer<ByteBuf, String> toString(String enc);  }