| 1 |
/* |
| 2 |
* |
| 3 |
* Licensed to the Apache Software Foundation (ASF) under one |
| 4 |
* or more contributor license agreements. See the NOTICE file |
| 5 |
* distributed with this work for additional information |
| 6 |
* regarding copyright ownership. The ASF licenses this file |
| 7 |
* to you under the Apache License, Version 2.0 (the |
| 8 |
* "License"); you may not use this file except in compliance |
| 9 |
* with the License. You may obtain a copy of the License at |
| 10 |
* |
| 11 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
* |
| 13 |
* Unless required by applicable law or agreed to in writing, |
| 14 |
* software distributed under the License is distributed on an |
| 15 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 |
* KIND, either express or implied. See the License for the |
| 17 |
* specific language governing permissions and limitations |
| 18 |
* under the License. |
| 19 |
* |
| 20 |
*/ |
| 21 |
package org.apache.qpid.proton.codec; |
| 22 |
|
| 23 |
public interface EncodingCodes |
| 24 |
{ |
| 25 |
public static final byte DESCRIBED_TYPE_INDICATOR = (byte) 0x00; |
| 26 |
|
| 27 |
public static final byte NULL = (byte) 0x40; |
| 28 |
|
| 29 |
public static final byte BOOLEAN = (byte) 0x56; |
| 30 |
public static final byte BOOLEAN_TRUE = (byte) 0x41; |
| 31 |
public static final byte BOOLEAN_FALSE = (byte) 0x42; |
| 32 |
|
| 33 |
public static final byte UBYTE = (byte) 0x50; |
| 34 |
|
| 35 |
public static final byte USHORT = (byte) 0x60; |
| 36 |
|
| 37 |
public static final byte UINT = (byte) 0x70; |
| 38 |
public static final byte SMALLUINT = (byte) 0x52; |
| 39 |
public static final byte UINT0 = (byte) 0x43; |
| 40 |
|
| 41 |
public static final byte ULONG = (byte) 0x80; |
| 42 |
public static final byte SMALLULONG = (byte) 0x53; |
| 43 |
public static final byte ULONG0 = (byte) 0x44; |
| 44 |
|
| 45 |
public static final byte BYTE = (byte) 0x51; |
| 46 |
|
| 47 |
public static final byte SHORT = (byte) 0x61; |
| 48 |
|
| 49 |
public static final byte INT = (byte) 0x71; |
| 50 |
public static final byte SMALLINT = (byte) 0x54; |
| 51 |
|
| 52 |
public static final byte LONG = (byte) 0x81; |
| 53 |
public static final byte SMALLLONG = (byte) 0x55; |
| 54 |
|
| 55 |
public static final byte FLOAT = (byte) 0x72; |
| 56 |
|
| 57 |
public static final byte DOUBLE = (byte) 0x82; |
| 58 |
|
| 59 |
public static final byte DECIMAL32 = (byte) 0x74; |
| 60 |
|
| 61 |
public static final byte DECIMAL64 = (byte) 0x84; |
| 62 |
|
| 63 |
public static final byte DECIMAL128 = (byte) 0x94; |
| 64 |
|
| 65 |
public static final byte CHAR = (byte) 0x73; |
| 66 |
|
| 67 |
public static final byte TIMESTAMP = (byte) 0x83; |
| 68 |
|
| 69 |
public static final byte UUID = (byte) 0x98; |
| 70 |
|
| 71 |
public static final byte VBIN8 = (byte) 0xa0; |
| 72 |
public static final byte VBIN32 = (byte) 0xb0; |
| 73 |
|
| 74 |
public static final byte STR8 = (byte) 0xa1; |
| 75 |
public static final byte STR32 = (byte) 0xb1; |
| 76 |
|
| 77 |
public static final byte SYM8 = (byte) 0xa3; |
| 78 |
public static final byte SYM32 = (byte) 0xb3; |
| 79 |
|
| 80 |
public static final byte LIST0 = (byte) 0x45; |
| 81 |
public static final byte LIST8 = (byte) 0xc0; |
| 82 |
public static final byte LIST32 = (byte) 0xd0; |
| 83 |
|
| 84 |
public static final byte MAP8 = (byte) 0xc1; |
| 85 |
public static final byte MAP32 = (byte) 0xd1; |
| 86 |
|
| 87 |
public static final byte ARRAY8 = (byte) 0xe0; |
| 88 |
public static final byte ARRAY32 = (byte) 0xf0; |
| 89 |
|
| 90 |
static String toString(byte encoding) { |
| 91 |
switch (encoding) { |
| 92 |
case DESCRIBED_TYPE_INDICATOR: |
| 93 |
return "DESCRIBED_TYPE_INDICATOR:0x00"; |
| 94 |
case NULL: |
| 95 |
return "NULL:0x40"; |
| 96 |
case BOOLEAN: |
| 97 |
return "BOOLEAN:0x56"; |
| 98 |
case BOOLEAN_TRUE: |
| 99 |
return "BOOLEAN_TRUE:0x41"; |
| 100 |
case BOOLEAN_FALSE: |
| 101 |
return "BOOLEAN_FALSE:0x42"; |
| 102 |
case UBYTE: |
| 103 |
return "UBYTE:0x50"; |
| 104 |
case USHORT: |
| 105 |
return "USHORT:0x60"; |
| 106 |
case UINT: |
| 107 |
return "UINT:0x70"; |
| 108 |
case SMALLUINT: |
| 109 |
return "SMALLUINT:0x52"; |
| 110 |
case UINT0: |
| 111 |
return "UINT0:0x43"; |
| 112 |
case ULONG: |
| 113 |
return "ULONG:0x80"; |
| 114 |
case SMALLULONG: |
| 115 |
return "SMALLULONG:0x53"; |
| 116 |
case ULONG0: |
| 117 |
return "ULONG0:0x44"; |
| 118 |
case BYTE: |
| 119 |
return "BYTE:0x51"; |
| 120 |
case SHORT: |
| 121 |
return "SHORT:0x61"; |
| 122 |
case INT: |
| 123 |
return "INT:0x71"; |
| 124 |
case SMALLINT: |
| 125 |
return "SMALLINT:0x54"; |
| 126 |
case LONG: |
| 127 |
return "LONG:0x81"; |
| 128 |
case SMALLLONG: |
| 129 |
return "SMALLLONG:0x55"; |
| 130 |
case FLOAT: |
| 131 |
return "FLOAT:0x72"; |
| 132 |
case DOUBLE: |
| 133 |
return "DOUBLE:0x82"; |
| 134 |
case DECIMAL32: |
| 135 |
return "DECIMAL32:0x74"; |
| 136 |
case DECIMAL64: |
| 137 |
return "DECIMAL64:0x84"; |
| 138 |
case DECIMAL128: |
| 139 |
return "DECIMAL128:0x94"; |
| 140 |
case CHAR: |
| 141 |
return "CHAR:0x73"; |
| 142 |
case TIMESTAMP: |
| 143 |
return "TIMESTAMP:0x83"; |
| 144 |
case UUID: |
| 145 |
return "UUID:0x98"; |
| 146 |
case VBIN8: |
| 147 |
return "VBIN8:0xa0"; |
| 148 |
case VBIN32: |
| 149 |
return "VBIN32:0xb0"; |
| 150 |
case STR8: |
| 151 |
return "STR8:0xa1"; |
| 152 |
case STR32: |
| 153 |
return "STR32:0xb1"; |
| 154 |
case SYM8: |
| 155 |
return "SYM8:0xa3"; |
| 156 |
case SYM32: |
| 157 |
return "SYM32:0xb3"; |
| 158 |
case LIST0: |
| 159 |
return "LIST0:0x45"; |
| 160 |
case LIST8: |
| 161 |
return "LIST8:0xc0"; |
| 162 |
case LIST32: |
| 163 |
return "LIST32:0xd0"; |
| 164 |
case MAP8: |
| 165 |
return "MAP8:0xc1"; |
| 166 |
case MAP32: |
| 167 |
return "MAP32:0xd1"; |
| 168 |
case ARRAY8: |
| 169 |
return "ARRAY8:0xe0"; |
| 170 |
case ARRAY32: |
| 171 |
return "ARRAY32:0xf0"; |
| 172 |
default: |
| 173 |
return "Unknown-Type:" + String.format("0x%02X", encoding); |
| 174 |
} |
| 175 |
} |
| 176 |
} |