NNTP-Posting-Date: Wed, 08 May 2013 12:25:51 -0500 Date: Wed, 08 May 2013 18:25:50 +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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 55 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-4WV88L/rh3IGcNxbXmodONLvidR76mhNaW2E9oJMT3Bb7aud6uYU2+Cb3sCUMAHpm+K1QYOs4wWS633!GUZdRz81X66lGj+me3TpE+cvQfR2XgSCD2fBc3t4+M4r+H77gEg7OANJqhCKWJm8IvUUoR3cePw= 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: 3334 Path: csiph.com!usenet.pasdenom.info!news.stben.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 Xref: csiph.com comp.lang.java.programmer:23939 On 08/05/13 17:46, Daniele Futtorovic wrote: > On 08/05/2013 18:17, lipska the kat allegedly wrote: >> On 08/05/13 16:32, Daniele Futtorovic wrote: >>> On 08/05/2013 15:57, lipska the kat allegedly 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, it's more consistent in OO code and, as I >>>> understand things, post autoboxing, the following two lines are >>>> logically equivalent. >>>> >>>> 1. Byte[][] bytes = new Byte[width][height]; >>>> 2. byte[][] bytes = new byte[width][length] >> >> typo notwithstanding oops :-( >> >>>> The following is perfectly legal given either of the above >>>> >>>> byte b = 127; >>>> bytes[0][0] = b; >>>> Byte c = 126; >>>> bytes[0][1] = c; >>>> Byte d = bytes[0][0]; >>>> byte e = bytes[0][1]; >>>> >>>> I would of course be interested to know what your objection is. >>> >>> Simple: "byte[]" is not a primitive type. >> >> I wasn't aware that I said it was > > When I called out your using a Byte[] rather than byte[] in your example > code, you defended it on the grounds of an alleged "common practice" to > use (boxed) reference types instead of primitive types. Thereby, you > have implied that byte[] was a primitive type; There was no such implication, you are mistaken. I have admitted elsewhere that it was 'less than optimal' to suggest Byte[][]. I did it for purely 'OO' reasons. Interesting reactions though. lipska -- Lipska the KatŠ: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun