1. Project Clover database Wed Jan 17 2024 23:40:18 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
38
23
3
0.6
1.67
3
1

Classes

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

Contributing tests

This file is covered by 12 tests. .

Source view

1    package org.europa.together.domain;
2   
3    /**
4    * Existing Byte Order Mark (BOM) types.
5    */
 
6    public enum ByteOrderMark {
7   
8    NONE("NONE", new byte[]{}),
9    UTF_8("UTF-8", new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF}),
10    UTF_16LE("UTF-16LE", new byte[]{(byte) 0xFF, (byte) 0xFE}),
11    UTF_16BE("UTF-16BE", new byte[]{(byte) 0xFE, (byte) 0xFF}),
12    UTF_32LE("UTF-32LE", new byte[]{(byte) 0xFF, (byte) 0xFE, (byte) 0x00, (byte) 0x00}),
13    UTF_32BE("UTF-32BE", new byte[]{(byte) 0x00, (byte) 0x00, (byte) 0xFE, (byte) 0xFF});
14   
15    private final String type;
16    private final byte[] value;
17   
18    //CONSTRUCTOR
 
19  6 toggle ByteOrderMark(final String type, final byte[] value) {
20  6 this.type = type;
21  6 this.value = value;
22    }
23   
24    /**
25    * Get the Byte vale for a Byte Order.
26    *
27    * @return value as Byte
28    */
 
29  87 toggle public byte[] getBytes() {
30  87 byte[] val = this.value;
31  87 return val;
32    }
33   
 
34  32 toggle @Override
35    public String toString() {
36  32 return this.type;
37    }
38    }