Lines Matching defs:offset
114 // if (false) Log.d(TAG, "clock offset: " + clockOffset + " ms");
162 * Reads an unsigned 32 bit big endian number from the given offset in the buffer.
164 private long read32(byte[] buffer, int offset) {
165 byte b0 = buffer[offset];
166 byte b1 = buffer[offset+1];
167 byte b2 = buffer[offset+2];
168 byte b3 = buffer[offset+3];
180 * Reads the NTP time stamp at the given offset in the buffer and returns
183 private long readTimeStamp(byte[] buffer, int offset) {
184 long seconds = read32(buffer, offset);
185 long fraction = read32(buffer, offset + 4);
191 * at the given offset in the buffer.
193 private void writeTimeStamp(byte[] buffer, int offset, long time) {
199 buffer[offset++] = (byte)(seconds >> 24);
200 buffer[offset++] = (byte)(seconds >> 16);
201 buffer[offset++] = (byte)(seconds >> 8);
202 buffer[offset++] = (byte)(seconds >> 0);
206 buffer[offset++] = (byte)(fraction >> 24);
207 buffer[offset++] = (byte)(fraction >> 16);
208 buffer[offset++] = (byte)(fraction >> 8);
210 buffer[offset++] = (byte)(Math.random() * 255.0);