Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 08 May 2013 11:48:45 -0500 Date: Wed, 08 May 2013 17:48:44 +0100 From: lipska the kat <"nospam at neversurrender dot co dot uk"> Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: How to convert image into Hex 2 Dimensional Array? References: <41718873-b1a6-4b97-bbbb-8002c48d4e29@googlegroups.com> <_4uit.18441$MS1.11557@newsfe05.iad> In-Reply-To: <_4uit.18441$MS1.11557@newsfe05.iad> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 43 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-4KSHG7gZuvlTV0eQTrzLa0KQQKg7z0H5QQVIU5ebba+VXQnR9tefGx/GsBzGl5RaWEX5nWurt5tgRwz!h0LLbg1m7lmqeeohh3T7iS7YY/YNaiEz6Hgrm5acNposxTFBrdQD0FT0eoMylj/9UfDWSO3Y3+o= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3126 Xref: csiph.com comp.lang.java.programmer:23936 On 08/05/13 16:22, Daniel Pitts wrote: > On 5/8/13 6:57 AM, lipska the kat wrote: >> On 08/05/13 14:19, Daniele Futtorovic wrote: >>> On 08/05/2013 10:06, lipska the kat allegedly wrote: >>>> Byte[][] bytes = new Byte[width][height]; >>> >>> Lipska, mind the difference between Byte and byte. That code above is >>> extremely bad advice. >> >> Why? it's common practice these days to eschew primitives and use >> (autoboxing) classes > Common practice where? Cite a credible source or I'll be forced to think > that you are just making up facts to support your mistake. My 4 year > old daughter does that; you want to be more credible than my 4 year old, > don't you? Hmm http://docs.oracle.com/javase/1.5.0/docs/guide/language/autoboxing.html So when should you use autoboxing and unboxing? Use them only when there is an “impedance mismatch” between reference types and primitives, for example, when you have to put numerical values into a collection. It is not appropriate to use autoboxing and unboxing for scientific computing, or other performance-sensitive numerical code. An Integer is not a substitute for an int; autoboxing and unboxing blur the distinction between primitive types and reference types, but they do not eliminate it. So, I'll agree that my assertion of logical equivalence is bollocks However I'm still not convinced that mixing primitives and reference types is a 'good idea' in OO code. But given the above I'll concede that suggesting Byte[][] was possibly poor advice, byte[][] might be better. [snip] -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun