Hi all
Yes... I know yet another thread started by me.
I'm trying to put an int into a ByteBuffer instance. However, the putInt() methods in the ByteBuffer API are specified as "optional operation"s. In my google searches I've discovered this means they throw an UnsupportedOperationException at runtime if they are not supported.
I've enountered them somewhere else, but I can't remember where. Maybe something to do with Charsets. Anyway, I remember wherever I did see them, they came with an "isSupported()" method or some such thing.
I have two questions:
Is there any way to determine at runtime if any of the putInt() methods are supported without just trying it to see if it throws an exceptioni?
Under what conditions will these methods throw and not throw the UnsupportedOperationException?
I thought that you might only be definitely able to use putInt methods in an IntBuffer instance... but no! They are "optional operation"s there as well.
Any thoughts anyone?
Michal
[ September 04, 2004: Message edited by: Michal Charemza ]
Yes... I know yet another thread started by me.
I'm trying to put an int into a ByteBuffer instance. However, the putInt() methods in the ByteBuffer API are specified as "optional operation"s. In my google searches I've discovered this means they throw an UnsupportedOperationException at runtime if they are not supported.
I've enountered them somewhere else, but I can't remember where. Maybe something to do with Charsets. Anyway, I remember wherever I did see them, they came with an "isSupported()" method or some such thing.
I have two questions:
Is there any way to determine at runtime if any of the putInt() methods are supported without just trying it to see if it throws an exceptioni?
Under what conditions will these methods throw and not throw the UnsupportedOperationException?
I thought that you might only be definitely able to use putInt methods in an IntBuffer instance... but no! They are "optional operation"s there as well.
Any thoughts anyone?
Michal
[ September 04, 2004: Message edited by: Michal Charemza ]