KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pdfbox > persistence > util > COSHEXTable


1 /**
2  * Copyright (c) 2003, www.pdfbox.org
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * 3. Neither the name of pdfbox; nor the names of its
14  * contributors may be used to endorse or promote products derived from this
15  * software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * http://www.pdfbox.org
29  *
30  */

31 package org.pdfbox.persistence.util;
32
33 /**
34  * helper type for faster mapping of bytes to their hex equivalent.
35  *
36  * @author Michael Traut
37  * @version $Revision: 1.4 $
38  */

39 public final class COSHEXTable
40 {
41     /**
42      * ASCII byte values for the hex strings.
43      */

44     public static final byte[][] TABLE =
45         {
46             "00".getBytes(),
47             "01".getBytes(),
48             "02".getBytes(),
49             "03".getBytes(),
50             "04".getBytes(),
51             "05".getBytes(),
52             "06".getBytes(),
53             "07".getBytes(),
54             "08".getBytes(),
55             "09".getBytes(),
56             "0A".getBytes(),
57             "0B".getBytes(),
58             "0C".getBytes(),
59             "0D".getBytes(),
60             "0E".getBytes(),
61             "0F".getBytes(),
62             "10".getBytes(),
63             "11".getBytes(),
64             "12".getBytes(),
65             "13".getBytes(),
66             "14".getBytes(),
67             "15".getBytes(),
68             "16".getBytes(),
69             "17".getBytes(),
70             "18".getBytes(),
71             "19".getBytes(),
72             "1A".getBytes(),
73             "1B".getBytes(),
74             "1C".getBytes(),
75             "1D".getBytes(),
76             "1E".getBytes(),
77             "1F".getBytes(),
78             "20".getBytes(),
79             "21".getBytes(),
80             "22".getBytes(),
81             "23".getBytes(),
82             "24".getBytes(),
83             "25".getBytes(),
84             "26".getBytes(),
85             "27".getBytes(),
86             "28".getBytes(),
87             "29".getBytes(),
88             "2A".getBytes(),
89             "2B".getBytes(),
90             "2C".getBytes(),
91             "2D".getBytes(),
92             "2E".getBytes(),
93             "2F".getBytes(),
94             "30".getBytes(),
95             "31".getBytes(),
96             "32".getBytes(),
97             "33".getBytes(),
98             "34".getBytes(),
99             "35".getBytes(),
100             "36".getBytes(),
101             "37".getBytes(),
102             "38".getBytes(),
103             "39".getBytes(),
104             "3A".getBytes(),
105             "3B".getBytes(),
106             "3C".getBytes(),
107             "3D".getBytes(),
108             "3E".getBytes(),
109             "3F".getBytes(),
110             "40".getBytes(),
111             "41".getBytes(),
112             "42".getBytes(),
113             "43".getBytes(),
114             "44".getBytes(),
115             "45".getBytes(),
116             "46".getBytes(),
117             "47".getBytes(),
118             "48".getBytes(),
119             "49".getBytes(),
120             "4A".getBytes(),
121             "4B".getBytes(),
122             "4C".getBytes(),
123             "4D".getBytes(),
124             "4E".getBytes(),
125             "4F".getBytes(),
126             "50".getBytes(),
127             "51".getBytes(),
128             "52".getBytes(),
129             "53".getBytes(),
130             "54".getBytes(),
131             "55".getBytes(),
132             "56".getBytes(),
133             "57".getBytes(),
134             "58".getBytes(),
135             "59".getBytes(),
136             "5A".getBytes(),
137             "5B".getBytes(),
138             "5C".getBytes(),
139             "5D".getBytes(),
140             "5E".getBytes(),
141             "5F".getBytes(),
142             "60".getBytes(),
143             "61".getBytes(),
144             "62".getBytes(),
145             "63".getBytes(),
146             "64".getBytes(),
147             "65".getBytes(),
148             "66".getBytes(),
149             "67".getBytes(),
150             "68".getBytes(),
151             "69".getBytes(),
152             "6A".getBytes(),
153             "6B".getBytes(),
154             "6C".getBytes(),
155             "6D".getBytes(),
156             "6E".getBytes(),
157             "6F".getBytes(),
158             "70".getBytes(),
159             "71".getBytes(),
160             "72".getBytes(),
161             "73".getBytes(),
162             "74".getBytes(),
163             "75".getBytes(),
164             "76".getBytes(),
165             "77".getBytes(),
166             "78".getBytes(),
167             "79".getBytes(),
168             "7A".getBytes(),
169             "7B".getBytes(),
170             "7C".getBytes(),
171             "7D".getBytes(),
172             "7E".getBytes(),
173             "7F".getBytes(),
174             "80".getBytes(),
175             "81".getBytes(),
176             "82".getBytes(),
177             "83".getBytes(),
178             "84".getBytes(),
179             "85".getBytes(),
180             "86".getBytes(),
181             "87".getBytes(),
182             "88".getBytes(),
183             "89".getBytes(),
184             "8A".getBytes(),
185             "8B".getBytes(),
186             "8C".getBytes(),
187             "8D".getBytes(),
188             "8E".getBytes(),
189             "8F".getBytes(),
190             "90".getBytes(),
191             "91".getBytes(),
192             "92".getBytes(),
193             "93".getBytes(),
194             "94".getBytes(),
195             "95".getBytes(),
196             "96".getBytes(),
197             "97".getBytes(),
198             "98".getBytes(),
199             "99".getBytes(),
200             "9A".getBytes(),
201             "9B".getBytes(),
202             "9C".getBytes(),
203             "9D".getBytes(),
204             "9E".getBytes(),
205             "9F".getBytes(),
206             "A0".getBytes(),
207             "A1".getBytes(),
208             "A2".getBytes(),
209             "A3".getBytes(),
210             "A4".getBytes(),
211             "A5".getBytes(),
212             "A6".getBytes(),
213             "A7".getBytes(),
214             "A8".getBytes(),
215             "A9".getBytes(),
216             "AA".getBytes(),
217             "AB".getBytes(),
218             "AC".getBytes(),
219             "AD".getBytes(),
220             "AE".getBytes(),
221             "AF".getBytes(),
222             "B0".getBytes(),
223             "B1".getBytes(),
224             "B2".getBytes(),
225             "B3".getBytes(),
226             "B4".getBytes(),
227             "B5".getBytes(),
228             "B6".getBytes(),
229             "B7".getBytes(),
230             "B8".getBytes(),
231             "B9".getBytes(),
232             "BA".getBytes(),
233             "BB".getBytes(),
234             "BC".getBytes(),
235             "BD".getBytes(),
236             "BE".getBytes(),
237             "BF".getBytes(),
238             "C0".getBytes(),
239             "C1".getBytes(),
240             "C2".getBytes(),
241             "C3".getBytes(),
242             "C4".getBytes(),
243             "C5".getBytes(),
244             "C6".getBytes(),
245             "C7".getBytes(),
246             "C8".getBytes(),
247             "C9".getBytes(),
248             "CA".getBytes(),
249             "CB".getBytes(),
250             "CC".getBytes(),
251             "CD".getBytes(),
252             "CE".getBytes(),
253             "CF".getBytes(),
254             "D0".getBytes(),
255             "D1".getBytes(),
256             "D2".getBytes(),
257             "D3".getBytes(),
258             "D4".getBytes(),
259             "D5".getBytes(),
260             "D6".getBytes(),
261             "D7".getBytes(),
262             "D8".getBytes(),
263             "D9".getBytes(),
264             "DA".getBytes(),
265             "DB".getBytes(),
266             "DC".getBytes(),
267             "DD".getBytes(),
268             "DE".getBytes(),
269             "DF".getBytes(),
270             "E0".getBytes(),
271             "E1".getBytes(),
272             "E2".getBytes(),
273             "E3".getBytes(),
274             "E4".getBytes(),
275             "E5".getBytes(),
276             "E6".getBytes(),
277             "E7".getBytes(),
278             "E8".getBytes(),
279             "E9".getBytes(),
280             "EA".getBytes(),
281             "EB".getBytes(),
282             "EC".getBytes(),
283             "ED".getBytes(),
284             "EE".getBytes(),
285             "EF".getBytes(),
286             "F0".getBytes(),
287             "F1".getBytes(),
288             "F2".getBytes(),
289             "F3".getBytes(),
290             "F4".getBytes(),
291             "F5".getBytes(),
292             "F6".getBytes(),
293             "F7".getBytes(),
294             "F8".getBytes(),
295             "F9".getBytes(),
296             "FA".getBytes(),
297             "FB".getBytes(),
298             "FC".getBytes(),
299             "FD".getBytes(),
300             "FE".getBytes(),
301             "FF".getBytes()
302             };
303
304     /**
305      * ASCII byte values for the hex strings.
306      */

307     public static final String JavaDoc[] HEX_TABLE =
308         {
309             "00",
310             "01",
311             "02",
312             "03",
313             "04",
314             "05",
315             "06",
316             "07",
317             "08",
318             "09",
319             "0A",
320             "0B",
321             "0C",
322             "0D",
323             "0E",
324             "0F",
325             "10",
326             "11",
327             "12",
328             "13",
329             "14",
330             "15",
331             "16",
332             "17",
333             "18",
334             "19",
335             "1A",
336             "1B",
337             "1C",
338             "1D",
339             "1E",
340             "1F",
341             "20",
342             "21",
343             "22",
344             "23",
345             "24",
346             "25",
347             "26",
348             "27",
349             "28",
350             "29",
351             "2A",
352             "2B",
353             "2C",
354             "2D",
355             "2E",
356             "2F",
357             "30",
358             "31",
359             "32",
360             "33",
361             "34",
362             "35",
363             "36",
364             "37",
365             "38",
366             "39",
367             "3A",
368             "3B",
369             "3C",
370             "3D",
371             "3E",
372             "3F",
373             "40",
374             "41",
375             "42",
376             "43",
377             "44",
378             "45",
379             "46",
380             "47",
381             "48",
382             "49",
383             "4A",
384             "4B",
385             "4C",
386             "4D",
387             "4E",
388             "4F",
389             "50",
390             "51",
391             "52",
392             "53",
393             "54",
394             "55",
395             "56",
396             "57",
397             "58",
398             "59",
399             "5A",
400             "5B",
401             "5C",
402             "5D",
403             "5E",
404             "5F",
405             "60",
406             "61",
407             "62",
408             "63",
409             "64",
410             "65",
411             "66",
412             "67",
413             "68",
414             "69",
415             "6A",
416             "6B",
417             "6C",
418             "6D",
419             "6E",
420             "6F",
421             "70",
422             "71",
423             "72",
424             "73",
425             "74",
426             "75",
427             "76",
428             "77",
429             "78",
430             "79",
431             "7A",
432             "7B",
433             "7C",
434             "7D",
435             "7E",
436             "7F",
437             "80",
438             "81",
439             "82",
440             "83",
441             "84",
442             "85",
443             "86",
444             "87",
445             "88",
446             "89",
447             "8A",
448             "8B",
449             "8C",
450             "8D",
451             "8E",
452             "8F",
453             "90",
454             "91",
455             "92",
456             "93",
457             "94",
458             "95",
459             "96",
460             "97",
461             "98",
462             "99",
463             "9A",
464             "9B",
465             "9C",
466             "9D",
467             "9E",
468             "9F",
469             "A0",
470             "A1",
471             "A2",
472             "A3",
473             "A4",
474             "A5",
475             "A6",
476             "A7",
477             "A8",
478             "A9",
479             "AA",
480             "AB",
481             "AC",
482             "AD",
483             "AE",
484             "AF",
485             "B0",
486             "B1",
487             "B2",
488             "B3",
489             "B4",
490             "B5",
491             "B6",
492             "B7",
493             "B8",
494             "B9",
495             "BA",
496             "BB",
497             "BC",
498             "BD",
499             "BE",
500             "BF",
501             "C0",
502             "C1",
503             "C2",
504             "C3",
505             "C4",
506             "C5",
507             "C6",
508             "C7",
509             "C8",
510             "C9",
511             "CA",
512             "CB",
513             "CC",
514             "CD",
515             "CE",
516             "CF",
517             "D0",
518             "D1",
519             "D2",
520             "D3",
521             "D4",
522             "D5",
523             "D6",
524             "D7",
525             "D8",
526             "D9",
527             "DA",
528             "DB",
529             "DC",
530             "DD",
531             "DE",
532             "DF",
533             "E0",
534             "E1",
535             "E2",
536             "E3",
537             "E4",
538             "E5",
539             "E6",
540             "E7",
541             "E8",
542             "E9",
543             "EA",
544             "EB",
545             "EC",
546             "ED",
547             "EE",
548             "EF",
549             "F0",
550             "F1",
551             "F2",
552             "F3",
553             "F4",
554             "F5",
555             "F6",
556             "F7",
557             "F8",
558             "F9",
559             "FA",
560             "FB",
561             "FC",
562             "FD",
563             "FE",
564             "FF"
565             };
566 }
Popular Tags