アルゴリズムの一部について意見やアドバイスを求めたいと思います。
ByteBuffer bb = ByteBuffer.allocate(8);
bb.putLong(rs.getLong(index));//retrieve long from db (unsigned INT)
byte[] tmp = new byte[4];
bb.position(4);
bb.get(tmp);
(Inet4Address) InetAddress.getByAddress(tmp);
対。
ByteBuffer bb = ByteBuffer.allocate(4);
bb.putInt((int) rs.getLong(index));//retrieve long from db (unsigned INT)
bb.flip();
byte[] tmp = new byte[4];
bb.get(tmp);
(Inet4Address) InetAddress.getByAddress(tmp);
基本的に、キャストにパフォーマンスの違いがあるのか 、それともより大きなByteBufferを使用する方が良いのかを知りたい.
ありがとうございます。それでは、お元気で、
マレク