adapting WriteStream to java.io.OutputStream

177 views
Skip to first unread message

petermd

unread,
Feb 13, 2013, 8:28:42 AM2/13/13
to ve...@googlegroups.com
hi,

(new (yesterday) to vert.x. very positive so far, thx to tim & everyone)

i need to map some code that outputs to java.io.OutputStream to a HttpServerResponse/WriteStream. current approach is to write a simple wrapper that delegates calls to underlying Buffer and then writes that to the stream.

Q1: has anyone done this already? or is there a better way?

if not, it would help performance if Buffer.appendBytes() provided the extended appendBytes(byte[],off,len) signature so I can efficiently map the OutputStream.write() call in chunks

Q2: any reason not to do this? (underlying DynamicChannelBuffer supports it)

thx in advance,
peter
Reply all
Reply to author
Forward
0 new messages