From: Christopher O. <chr...@fu...> - 2009-12-16 09:58:46
|
Well maybe except that the use of the ByteBuffer#array() is an optional operational and not guaranteed to be available. In general, the peer review is too uncritical for my taste with lots of opportunities for making the code added to Saros more robust and clean not taken. If you (all of you) assign a +1, I would expect that you have tried to find a way to break the code or uncover a weakness. If you merely "like" what another person did, then a +0 is more in order. Christopher On Wed, 16 Dec 2009 10:39:44 +0100, Henning Staib <hen...@fu...> wrote: > +1 > > nothing to complain. > > Regards, > Henning > > Am 13.12.2009 um 16:46 schrieb Sandor Szücs: > >> Hi, >> >> [FIX] BinaryChannel::getData() returned byte Array padded with NUL >> bytes. >> >> regards, Sandor Szücs >> -- >> >> Index: src/de/fu_berlin/inf/dpp/net/jingle/protocol/BinaryChannel.java >> =================================================================== >> --- src/de/fu_berlin/inf/dpp/net/jingle/protocol/BinaryChannel.java >> (revision 1883) >> +++ src/de/fu_berlin/inf/dpp/net/jingle/protocol/BinaryChannel.java >> (working copy) >> @@ -204,9 +204,16 @@ >> * Returns the byte Array for the given List of BinaryPacket. >> */ >> public static byte[] getData(List<BinaryPacket> list) { >> - ByteBuffer buf = ByteBuffer.allocate(list.size() * >> CHUNKSIZE); >> + int size = 0; >> + >> + for (BinaryPacket packet : list) { >> + size += packet.getSize(); >> + } >> + >> + ByteBuffer buf = ByteBuffer.allocate(size); >> for (BinaryPacket packet : list) >> buf.put(packet.body); >> + >> return buf.array(); >> } >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> Return on Information: >> Google Enterprise Search pays you back >> Get the facts. >> http://p.sf.net/sfu/google-dev2dev >> _______________________________________________ >> Dpp-devel mailing list >> Dpp...@li... >> https://lists.sourceforge.net/lists/listinfo/dpp-devel > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Dpp-devel mailing list > Dpp...@li... > https://lists.sourceforge.net/lists/listinfo/dpp-devel -- Christopher Oezbek | Freie Universität Berlin | Takustr. 9, 14195 Berlin http://www.inf.fu-berlin.de/~oezbek/ | +49 30 838 75242 | Raum 008 |