Lines Matching defs:offset
147 "clock offset: " + clockOffset + "ms");
213 * Reads an unsigned 32 bit big endian number from the given offset in the buffer.
215 private long read32(byte[] buffer, int offset) {
216 byte b0 = buffer[offset];
217 byte b1 = buffer[offset+1];
218 byte b2 = buffer[offset+2];
219 byte b3 = buffer[offset+3];
231 * Reads the NTP time stamp at the given offset in the buffer and returns
234 private long readTimeStamp(byte[] buffer, int offset) {
235 long seconds = read32(buffer, offset);
236 long fraction = read32(buffer, offset + 4);
246 * at the given offset in the buffer.
248 private void writeTimeStamp(byte[] buffer, int offset, long time) {
251 Arrays.fill(buffer, offset, offset + 8, (byte) 0x00);
260 buffer[offset++] = (byte)(seconds >> 24);
261 buffer[offset++] = (byte)(seconds >> 16);
262 buffer[offset++] = (byte)(seconds >> 8);
263 buffer[offset++] = (byte)(seconds >> 0);
267 buffer[offset++] = (byte)(fraction >> 24);
268 buffer[offset++] = (byte)(fraction >> 16);
269 buffer[offset++] = (byte)(fraction >> 8);
271 buffer[offset++] = (byte)(Math.random() * 255.0);