On Sat, Oct 22, 2011 at 9:01 PM, Nick Burch <[email protected]> wrote: > On Fri, 21 Oct 2011, [email protected] wrote: >> >> URL: http://svn.apache.org/viewvc?rev=1187568&view=rev >> Log: >> it's better to always specify offset for write and reading operations >> deprecate methods with default (0) offset > > I'm not sure I see the point of deprecating these helper methods? I think > they're handy at times, and I don't see the harm of having them there to > make people's lives easier and their code simpler? If the only thing that user doing is to "wrap" some single value in byte[] array, it seems he's doing something non optimal. Either it should be part of bigger array, or adding to array shall be replaced with writing to OutputStream.
And if this is a case when we adding first element to array at the beginning, and continue later, than code like LittleEndian.putInt( array, 0, value1 ); LittleEndian.putInt( array, 4, value1 ); LittleEndian.putInt( array, 8, value1 ); is better than LittleEndian.putInt( array, value1 ); LittleEndian.putInt( array, 4, value1 ); LittleEndian.putInt( array, 8, value1 ); because no questions occure what's going on in the first line. Another though - there are a lot of methods in LittleEndian already. And I don't like the idead of duplicating putSomething ( array, offset, value ) with putSomething ( array, value ) for every "something". Not sure if worth to mention case when user selecting wrong method and forgot to set offset at all. -- Sergey Vladimirov --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
