1 /*
2  * %CopyrightBegin%
3  *
4  * Copyright Ericsson AB 2000-2016. All Rights Reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * %CopyrightEnd%
19  */
20 package com.ericsson.otp.erlang;
21 
22 /**
23  * Provides a collection of constants used when encoding and decoding Erlang
24  * terms.
25  */
26 public class OtpExternal {
27     // no constructor
OtpExternal()28     private OtpExternal() {
29     }
30 
31     /** The tag used for small integers */
32     public static final int smallIntTag = 97;
33 
34     /** The tag used for integers */
35     public static final int intTag = 98;
36 
37     /** The tag used for floating point numbers */
38     public static final int floatTag = 99;
39     public static final int newFloatTag = 70;
40 
41     /** The tag used for atoms */
42     public static final int atomTag = 100;
43 
44     /** The tag used for old stype references */
45     public static final int refTag = 101;
46 
47     /** The tag used for ports */
48     public static final int portTag = 102;
49     public static final int newPortTag = 89;
50 
51     /** The tag used for PIDs */
52     public static final int pidTag = 103;
53     public static final int newPidTag = 88;
54 
55     /** The tag used for small tuples */
56     public static final int smallTupleTag = 104;
57 
58     /** The tag used for large tuples */
59     public static final int largeTupleTag = 105;
60 
61     /** The tag used for empty lists */
62     public static final int nilTag = 106;
63 
64     /** The tag used for strings and lists of small integers */
65     public static final int stringTag = 107;
66 
67     /** The tag used for non-empty lists */
68     public static final int listTag = 108;
69 
70     /** The tag used for binaries */
71     public static final int binTag = 109;
72 
73     /** The tag used for bitstrs */
74     public static final int bitBinTag = 77;
75 
76     /** The tag used for small bignums */
77     public static final int smallBigTag = 110;
78 
79     /** The tag used for large bignums */
80     public static final int largeBigTag = 111;
81 
82     /** The tag used for old new Funs */
83     public static final int newFunTag = 112;
84 
85     /** The tag used for external Funs (M:F/A) */
86     public static final int externalFunTag = 113;
87 
88     /** The tag used for new style references */
89     public static final int newRefTag = 114;
90     public static final int newerRefTag = 90;
91 
92     /** The tag used for maps */
93     public static final int mapTag = 116;
94 
95     /** The tag used for old Funs */
96     public static final int funTag = 117;
97 
98     /** The tag used for unicode atoms */
99     public static final int atomUtf8Tag = 118;
100 
101     /** The tag used for small unicode atoms */
102     public static final int smallAtomUtf8Tag = 119;
103 
104     /** The tag used for compressed terms */
105     public static final int compressedTag = 80;
106 
107     /** The version number used to mark serialized Erlang terms */
108     public static final int versionTag = 131;
109 
110     /** The largest value that can be encoded as an integer */
111     public static final int erlMax = (1 << 27) - 1;
112 
113     /** The smallest value that can be encoded as an integer */
114     public static final int erlMin = -(1 << 27);
115 
116     /** The longest allowed Erlang atom */
117     public static final int maxAtomLength = 255;
118 }
119