Here you can find the source of writeTimestamp(ByteBuffer logBuf, Timestamp time)
public static void writeTimestamp(ByteBuffer logBuf, Timestamp time)
//package com.java2s; /*-//from w w w .j a v a2 s.c o m * See the file LICENSE for redistribution information. * * Copyright (c) 2002,2007 Oracle. All rights reserved. * * $Id: LogUtils.java,v 1.50.2.1 2007/02/01 14:49:47 cwl Exp $ */ import java.nio.ByteBuffer; import java.sql.Timestamp; public class Main { /** * Write a timestamp into the log. */ public static void writeTimestamp(ByteBuffer logBuf, Timestamp time) { writeLong(logBuf, time.getTime()); } /** * Write a long into the log. */ public static void writeLong(ByteBuffer logBuf, long l) { byte b = (byte) (l >>> 0); logBuf.put(b); b = (byte) (l >>> 8); logBuf.put(b); b = (byte) (l >>> 16); logBuf.put(b); b = (byte) (l >>> 24); logBuf.put(b); b = (byte) (l >>> 32); logBuf.put(b); b = (byte) (l >>> 40); logBuf.put(b); b = (byte) (l >>> 48); logBuf.put(b); b = (byte) (l >>> 56); logBuf.put(b); } }