jdk/src/share/classes/java/time/chrono/ThaiBuddhistEra.java
changeset 19841 15c8e97d6a14
parent 17474 8c100beabcc0
child 20873 e91d5b1cb8e6
equal deleted inserted replaced
19822:4e10a58fa28f 19841:15c8e97d6a14
    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 }