Here you can find the source of writeTimestamp(Timestamp stamp, ObjectOutput out, long nullFlag)
public static void writeTimestamp(Timestamp stamp, ObjectOutput out, long nullFlag) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.ObjectOutput; import java.sql.Timestamp; public class Main { public static final int NULL = 0x00; public static final int NOTNULL = 0x01; public static void writeTimestamp(Timestamp stamp, ObjectOutput out, long nullFlag) throws IOException { if (stamp != null) { long value = stamp.getTime(); out.writeLong(value);/* w ww .ja va 2 s . c o m*/ } else { out.writeLong(nullFlag); } } public static void writeLong(Long num, ObjectOutput out) throws IOException { if (num == null) { out.writeByte(NULL); } else { out.writeByte(NOTNULL); out.writeLong(num); } } public static void writeByte(Byte num, ObjectOutput out) throws IOException { if (num == null) { out.writeByte(NULL); } else { out.writeByte(NOTNULL); out.writeByte(num); } } }