Puts a long into this byte vector. The byte vector is automatically enlarged if necessary. @param longValue a long. @return this byte vector.
(final long longValue)
| 213 | * @return this byte vector. |
| 214 | */ |
| 215 | public ByteVector putLong(final long longValue) { |
| 216 | int currentLength = length; |
| 217 | if (currentLength + 8 > data.length) { |
| 218 | enlarge(8); |
| 219 | } |
| 220 | byte[] currentData = data; |
| 221 | int intValue = (int) (longValue >>> 32); |
| 222 | currentData[currentLength++] = (byte) (intValue >>> 24); |
| 223 | currentData[currentLength++] = (byte) (intValue >>> 16); |
| 224 | currentData[currentLength++] = (byte) (intValue >>> 8); |
| 225 | currentData[currentLength++] = (byte) intValue; |
| 226 | intValue = (int) longValue; |
| 227 | currentData[currentLength++] = (byte) (intValue >>> 24); |
| 228 | currentData[currentLength++] = (byte) (intValue >>> 16); |
| 229 | currentData[currentLength++] = (byte) (intValue >>> 8); |
| 230 | currentData[currentLength++] = (byte) intValue; |
| 231 | length = currentLength; |
| 232 | return this; |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if |
no test coverage detected