webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Static Public Member Functions | |
static String | stringDefaultValue (String bytes) |
static byte [] | bytesDefaultValue (String bytes) |
static byte [] | copyFromUtf8 (final String text) |
static boolean | equals (int[] field1, int[] field2) |
static boolean | equals (long[] field1, long[] field2) |
static boolean | equals (float[] field1, float[] field2) |
static boolean | equals (double[] field1, double[] field2) |
static boolean | equals (boolean[] field1, boolean[] field2) |
static boolean | equals (byte[][] field1, byte[][] field2) |
static boolean | equals (Object[] field1, Object[] field2) |
static int | hashCode (int[] field) |
static int | hashCode (long[] field) |
static int | hashCode (float[] field) |
static int | hashCode (double[] field) |
static int | hashCode (boolean[] field) |
static int | hashCode (byte[][] field) |
static int | hashCode (Object[] field) |
static final< K, V > Map< K, V > | mergeMapEntry (CodedInputByteBufferNano input, Map< K, V > map, MapFactory mapFactory, int keyType, int valueType, V value, int keyTag, int valueTag) throws IOException |
static< K, V > void | serializeMapField (CodedOutputByteBufferNano output, Map< K, V > map, int number, int keyType, int valueType) throws IOException |
static< K, V > int | computeMapFieldSize (Map< K, V > map, int number, int keyType, int valueType) |
static< K, V > boolean | equals (Map< K, V > a, Map< K, V > b) |
static< K, V > int | hashCode (Map< K, V > map) |
static void | cloneUnknownFieldData (ExtendableMessageNano original, ExtendableMessageNano cloned) |
Static Public Attributes | |
static final int | TYPE_DOUBLE = 1 |
static final int | TYPE_FLOAT = 2 |
static final int | TYPE_INT64 = 3 |
static final int | TYPE_UINT64 = 4 |
static final int | TYPE_INT32 = 5 |
static final int | TYPE_FIXED64 = 6 |
static final int | TYPE_FIXED32 = 7 |
static final int | TYPE_BOOL = 8 |
static final int | TYPE_STRING = 9 |
static final int | TYPE_GROUP = 10 |
static final int | TYPE_MESSAGE = 11 |
static final int | TYPE_BYTES = 12 |
static final int | TYPE_UINT32 = 13 |
static final int | TYPE_ENUM = 14 |
static final int | TYPE_SFIXED32 = 15 |
static final int | TYPE_SFIXED64 = 16 |
static final int | TYPE_SINT32 = 17 |
static final int | TYPE_SINT64 = 18 |
static final Object | LAZY_INIT_LOCK = new Object() |
Static Protected Attributes | |
static final Charset | UTF_8 = Charset.forName("UTF-8") |
static final Charset | ISO_8859_1 = Charset.forName("ISO-8859-1") |
The classes contained within are used internally by the Protocol Buffer library and generated message implementations. They are public only because those generated messages do not reside in the
package. Others should not use this class directly.
|
inlinestatic |
Helper called by generated code to construct default values for bytes fields.
This is a lot like stringDefaultValue, but for bytes fields. In this case we only need the second of the two hacks – allowing us to embed raw bytes as a string literal with ISO-8859-1 encoding.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Helper function to convert a string into UTF-8 while turning the UnsupportedEncodingException to a RuntimeException.
|
inlinestatic |
Checks repeated int field equality; null-value and 0-length fields are considered equal.
|
inlinestatic |
Checks repeated long field equality; null-value and 0-length fields are considered equal.
|
inlinestatic |
Checks repeated float field equality; null-value and 0-length fields are considered equal.
|
inlinestatic |
Checks repeated double field equality; null-value and 0-length fields are considered equal.
|
inlinestatic |
Checks repeated boolean field equality; null-value and 0-length fields are considered equal.
|
inlinestatic |
Checks repeated bytes field equality. Only non-null elements are tested. Returns true if the two fields have the same sequence of non-null elements. Null-value fields and fields of any length with only null elements are considered equal.
|
inlinestatic |
Checks repeated string/message field equality. Only non-null elements are tested. Returns true if the two fields have the same sequence of non-null elements. Null-value fields and fields of any length with only null elements are considered equal.
|
inlinestatic |
Computes the hash code of a repeated int field. Null-value and 0-length fields have the same hash code.
|
inlinestatic |
Computes the hash code of a repeated long field. Null-value and 0-length fields have the same hash code.
|
inlinestatic |
Computes the hash code of a repeated float field. Null-value and 0-length fields have the same hash code.
|
inlinestatic |
Computes the hash code of a repeated double field. Null-value and 0-length fields have the same hash code.
|
inlinestatic |
Computes the hash code of a repeated boolean field. Null-value and 0-length fields have the same hash code.
|
inlinestatic |
Computes the hash code of a repeated bytes field. Only the sequence of all non-null elements are used in the computation. Null-value fields and fields of any length with only null elements have the same hash code.
|
inlinestatic |
Computes the hash code of a repeated string/message field. Only the sequence of all non-null elements are used in the computation. Null-value fields and fields of any length with only null elements have the same hash code.
|
inlinestatic |
Merges the map entry into the map field. Note this is only supposed to be called by generated messages.
map | the map field; may be null, in which case a map will be instantiated using the MapFactories.MapFactory |
input | the input byte buffer |
keyType | key type, as defined in InternalNano.TYPE_* |
valueType | value type, as defined in InternalNano.TYPE_* |
value | an new instance of the value, if the value is a TYPE_MESSAGE; otherwise this parameter can be null and will be ignored. |
keyTag | wire tag for the key |
valueTag | wire tag for the value |
IOException |
|
inlinestatic |
|
inlinestatic |
Helper called by generated code to construct default values for string fields.
The protocol compiler does not actually contain a UTF-8 decoder – it just pushes UTF-8-encoded text around without touching it. The one place where this presents a problem is when generating Java string literals. Unicode characters in the string literal would normally need to be encoded using a Unicode escape sequence, which would require decoding them. To get around this, protoc instead embeds the UTF-8 bytes into the generated code and leaves it to the runtime library to decode them.
It gets worse, though. If protoc just generated a byte array, like: new byte[] {0x12, 0x34, 0x56, 0x78} Java actually generates code which allocates an array and then fills in each value. This is much less efficient than just embedding the bytes directly into the bytecode. To get around this, we need another work-around. String literals are embedded directly, so protoc actually generates a string literal corresponding to the bytes. The easiest way to do this is to use the ISO-8859-1 character set, which corresponds to the first 256 characters of the Unicode range. Protoc can then use good old CEscape to generate the string.
So we have a string literal which represents a set of bytes which represents another string. This function – stringDefaultValue – converts from the generated string to the string we actually want. The generated code calls this automatically.
|
staticprotected |
An object to provide synchronization when lazily initializing static fields of MessageNano subclasses.
To enable earlier versions of ProGuard to inline short methods from a generated MessageNano subclass to the call sites, that class must not have a class initializer, which will be created if there is any static variable initializers. To lazily initialize the static variables in a thread-safe manner, the initialization code will synchronize on this object.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
staticprotected |