equal
deleted
inserted
replaced
59 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
59 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
60 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
60 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
61 */ |
61 */ |
62 package java.time.chrono; |
62 package java.time.chrono; |
63 |
63 |
64 import java.io.DataInput; |
|
65 import java.io.DataOutput; |
|
66 import java.io.IOException; |
|
67 import java.time.DateTimeException; |
64 import java.time.DateTimeException; |
68 |
65 |
69 /** |
66 /** |
70 * An era in the Thai Buddhist calendar system. |
67 * An era in the Thai Buddhist calendar system. |
71 * <p> |
68 * <p> |
153 @Override |
150 @Override |
154 public int getValue() { |
151 public int getValue() { |
155 return ordinal(); |
152 return ordinal(); |
156 } |
153 } |
157 |
154 |
158 //----------------------------------------------------------------------- |
|
159 private Object writeReplace() { |
|
160 return new Ser(Ser.THAIBUDDHIST_ERA_TYPE, this); |
|
161 } |
|
162 |
|
163 void writeExternal(DataOutput out) throws IOException { |
|
164 out.writeByte(this.getValue()); |
|
165 } |
|
166 |
|
167 static ThaiBuddhistEra readExternal(DataInput in) throws IOException { |
|
168 byte eraValue = in.readByte(); |
|
169 return ThaiBuddhistEra.of(eraValue); |
|
170 } |
|
171 |
|
172 } |
155 } |