Example #1
0
 public void serialize(Date object, byte[] stream, int startPosition, Object... hints) {
   Calendar calendar = Calendar.getInstance();
   calendar.setTime(object);
   calendar.set(Calendar.HOUR_OF_DAY, 0);
   calendar.set(Calendar.MINUTE, 0);
   calendar.set(Calendar.SECOND, 0);
   calendar.set(Calendar.MILLISECOND, 0);
   ODateTimeSerializer dateTimeSerializer = ODateTimeSerializer.INSTANCE;
   dateTimeSerializer.serialize(calendar.getTime(), stream, startPosition);
 }
Example #2
0
 /** {@inheritDoc} */
 @Override
 public void serializeInByteBufferObject(Date object, ByteBuffer buffer, Object... hints) {
   final Calendar calendar = Calendar.getInstance();
   calendar.setTime(object);
   calendar.set(Calendar.HOUR_OF_DAY, 0);
   calendar.set(Calendar.MINUTE, 0);
   calendar.set(Calendar.SECOND, 0);
   calendar.set(Calendar.MILLISECOND, 0);
   final ODateTimeSerializer dateTimeSerializer = ODateTimeSerializer.INSTANCE;
   dateTimeSerializer.serializeInByteBufferObject(calendar.getTime(), buffer);
 }
Example #3
0
 public Date deserializeNativeObject(byte[] stream, int startPosition) {
   ODateTimeSerializer dateTimeSerializer = ODateTimeSerializer.INSTANCE;
   return dateTimeSerializer.deserializeNativeObject(stream, startPosition);
 }
Example #4
0
 /** {@inheritDoc} */
 @Override
 public Date deserializeFromByteBufferObject(
     ByteBuffer buffer, OWALChanges walChanges, int offset) {
   final ODateTimeSerializer dateTimeSerializer = ODateTimeSerializer.INSTANCE;
   return dateTimeSerializer.deserializeFromByteBufferObject(buffer, walChanges, offset);
 }
Example #5
0
 /** {@inheritDoc} */
 @Override
 public Date deserializeFromByteBufferObject(ByteBuffer buffer) {
   final ODateTimeSerializer dateTimeSerializer = ODateTimeSerializer.INSTANCE;
   return dateTimeSerializer.deserializeFromByteBufferObject(buffer);
 }