1. Project Clover database Mon Dec 22 2025 14:59:38 CST
  2. Package org.europa.together.domain

File ByteOrderMark.java

 

Coverage histogram

../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
5
3
1
58
24
3
0.6
1.67
3
1

Classes

Class Line # Actions
ByteOrderMark 8 5 0% 3 0
1.0100%
 

Contributing tests

This file is covered by 11 tests. .

Source view

1    package org.europa.together.domain;
2   
3    import java.util.Arrays;
4   
5    /**
6    * Existing Byte Order Mark (BOM) types.
7    */
 
8    public enum ByteOrderMark {
9   
10    /**
11    * None.
12    */
13    NONE("NONE", new byte[]{}),
14    /**
15    * UTF-8.
16    */
17    UTF_8("UTF-8", new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF}),
18    /**
19    * UTF-16 Low Endian.
20    */
21    UTF_16LE("UTF-16LE", new byte[]{(byte) 0xFF, (byte) 0xFE}),
22    /**
23    * UTF-16 Big Endian.
24    */
25    UTF_16BE("UTF-16BE", new byte[]{(byte) 0xFE, (byte) 0xFF}),
26    /**
27    * UTF-32 Low Endian.
28    */
29    UTF_32LE("UTF-32LE", new byte[]{(byte) 0xFF, (byte) 0xFE, (byte) 0x00, (byte) 0x00}),
30    /**
31    * UTF-32 Big Endian.
32    */
33    UTF_32BE("UTF-32BE", new byte[]{(byte) 0x00, (byte) 0x00, (byte) 0xFE, (byte) 0xFF});
34   
35    private final String type;
36    private final byte[] value;
37   
38    //CONSTRUCTOR
 
39  6 toggle ByteOrderMark(final String type, final byte[] value) {
40  6 this.type = type;
41  6 this.value = value;
42    }
43   
44    /**
45    * Get the Byte vale for a Byte Order.
46    *
47    * @return value as Byte
48    */
 
49  82 toggle public byte[] getBytes() {
50  82 byte[] val = Arrays.copyOf(this.value, this.value.length);
51  82 return val;
52    }
53   
 
54  25 toggle @Override
55    public String toString() {
56  25 return this.type;
57    }
58    }