Lines Matching defs:offset
50 * Reads a packed integer at the given buffer offset and returns it.
54 * @param off the offset in the buffer at which to start reading.
89 * Reads a packed long integer at the given buffer offset and returns it.
93 * @param off the offset in the buffer at which to start reading.
144 * buffer. This method only accesses one byte at the given offset.</p>
148 * @param off the offset in the buffer at which to start reading.
169 * buffer. This method only accesses one byte at the given offset.</p>
173 * @param off the offset in the buffer at which to start reading.
184 * Writes a packed integer starting at the given buffer offset and returns
185 * the next offset to be written.
189 * @param offset the offset in the buffer at which to start writing.
193 * @return the offset past the bytes written.
195 public static int writeInt(byte[] buf, int offset, int value) {
197 int byte1Off = offset;
207 buf[offset++] = (byte) value;
208 return offset;
210 offset++;
212 buf[offset++] = (byte) value;
215 return offset;
218 buf[offset++] = (byte) (value >>> 8);
221 return offset;
224 buf[offset++] = (byte) (value >>> 16);
227 return offset;
230 buf[offset++] = (byte) (value >>> 24);
232 return offset;
236 * Writes a packed long integer starting at the given buffer offset and
237 * returns the next offset to be written.
241 * @param offset the offset in the buffer at which to start writing.
245 * @return the offset past the bytes written.
247 public static int writeLong(byte[] buf, int offset, long value) {
249 int byte1Off = offset;
259 buf[offset++] = (byte) value;
260 return offset;
262 offset++;
264 buf[offset++] = (byte) value;
267 return offset;
270 buf[offset++] = (byte) (value >>> 8);
273 return offset;
276 buf[offset++] = (byte) (value >>> 16);
279 return offset;
282 buf[offset++] = (byte) (value >>> 24);
285 return offset;
288 buf[offset++] = (byte) (value >>> 32);
291 return offset;
294 buf[offset++] = (byte) (value >>> 40);
297 return offset;
300 buf[offset++] = (byte) (value >>> 48);
303 return offset;
306 buf[offset++] = (byte) (value >>> 56);
308 return offset;