Don, how about this: byte[] my_array = ConvertToBytes(buffer); H5A.read(curAttID, curAttNativeType, new H5Array<Byte>(my_array));
// now do something with my_array H5Array<T> is really just a shell game. If you look at the (C++) source code, you'll see that no new arrays/elements are being allocated. Only references are being passed around. Best, G. > -----Original Message----- > From: [email protected] [mailto:hdf-forum- > [email protected]] On Behalf Of Donald Brandon > Sent: Sunday, September 04, 2011 11:16 AM > To: HDF Users Discussion List > Subject: Re: [Hdf-forum] H5Array Conversion > > Hey Gerb: > > I seen where you responded to this e-mail. Thank you, but I seem to have > lost your response somehow. In it, you had mentioned holding onto my > original array. I think I may be missing something. > > I am trying to read an attribute and its value. I can get the attribute > name but need to figure out how to get the value. > Here is what I am currently doing: > > H5Array<Byte> buffer2 = new H5Array<Byte>(ConvertToBytes(buffer)); > H5A.read(curAttID, curAttNativeType, buffer2); > > The original buffer is just an empty Byte[]. I convert it to an H5Array > and populate it with H5a.read(). So the original array won't do me any > good. How do I get a string out of the H5Array? H5Array.ToString() will > not do it. > > Thanks, > DB > > On 9/4/2011 12:29 AM, Donald Brandon wrote: > > Hey all: > > > > Does anyone know an easy way to convert an H5Array<Byte> object back > > to a Byte[]? > > Thanks. > > > > DB > > > > -- > Donald Brandon > 228-424-3958 (cell) > http://www.brandondl.com > > > _______________________________________________ > Hdf-forum is for HDF software users discussion. > [email protected] > http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
