Puts a short into this byte vector. The byte vector is automatically enlarged if necessary. @param shortValue a short. @return this byte vector.
(final int shortValue)
| 107 | * @return this byte vector. |
| 108 | */ |
| 109 | public ByteVector putShort(final int shortValue) { |
| 110 | int currentLength = length; |
| 111 | if (currentLength + 2 > data.length) { |
| 112 | enlarge(2); |
| 113 | } |
| 114 | byte[] currentData = data; |
| 115 | currentData[currentLength++] = (byte) (shortValue >>> 8); |
| 116 | currentData[currentLength++] = (byte) shortValue; |
| 117 | length = currentLength; |
| 118 | return this; |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Puts a byte and a short into this byte vector. The byte vector is automatically enlarged if |
no test coverage detected