Package org.apache.avro.reflect

# Class DateAsLongEncoding

java.lang.Object
org.apache.avro.reflect.CustomEncoding<Date>
org.apache.avro.reflect.DateAsLongEncoding

public class DateAsLongEncoding extends CustomEncoding<Date>
This encoder/decoder writes a java.util.Date object as a long to avro and reads a Date object from long. The long stores the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by the Date object.

## Field Summary

### Fields inherited from class org.apache.avro.reflect.CustomEncoding

`schema`

## Constructor Summary

Constructors
Constructor
Description
`DateAsLongEncoding()`

## Method Summary

Modifier and Type
Method
Description
`protected final Date`
`read(Object reuse, Decoder in)`
`protected final void`
`write(Object datum, Encoder out)`

### Methods inherited from class org.apache.avro.reflect.CustomEncoding

`getSchema`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DateAsLongEncoding

public DateAsLongEncoding()

## Method Details

### write

protected final void write(Object datum, Encoder out) throws IOException

Specified by:
  `write` in class `CustomEncoding<Date>`
Throws:
  `IOException`

### read

protected final Date read(Object reuse, Decoder in) throws IOException

Specified by:
  `read` in class `CustomEncoding<Date>`
Throws:
  `IOException`