MCPcopy Index your code
hub / github.com/clojure/clojure / putLong

Method putLong

src/jvm/clojure/asm/ByteVector.java:215–233  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

addConstantLongMethod · 0.80

Calls 1

enlargeMethod · 0.95

Tested by

no test coverage detected