207 |
for (int i = 0; i < 16; i += 2) |
for (int i = 0; i < 16; i += 2) |
208 |
{ |
{ |
209 |
int x = ((ipaddress[i] & 0xFF) << 8) | (ipaddress[i + 1] & 0xFF); |
int x = ((ipaddress[i] & 0xFF) << 8) | (ipaddress[i + 1] & 0xFF); |
|
boolean empty = sbuf.length() == 0; |
|
210 |
|
|
211 |
if (empty) |
if (i > 0) |
|
{ |
|
|
if (i > 0) |
|
|
sbuf.append("::"); |
|
|
} |
|
|
else |
|
212 |
sbuf.append(':'); |
sbuf.append(':'); |
213 |
|
|
214 |
if (x != 0 || i >= 14) |
sbuf.append(Integer.toHexString(x)); |
|
sbuf.append(Integer.toHexString(x)); |
|
215 |
} |
} |
216 |
|
|
217 |
return sbuf.toString(); |
return sbuf.toString(); |