001    package com.mucommander.io.bom;
002    /*
003     * This file is part of muCommander, http://www.mucommander.com
004     * Copyright (C) 2002-2008 Maxence Bernard
005     *
006     * muCommander is free software; you can redistribute it and/or modify
007     * it under the terms of the GNU General Public License as published by
008     * the Free Software Foundation; either version 3 of the License, or
009     * (at your option) any later version.
010     *
011     * muCommander is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015     *
016     * You should have received a copy of the GNU General Public License
017     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018     */
019    
020    /**
021     * This interface contains constants used by several classes of the BOM package.
022     *
023     * @author Maxence Bernard
024     */
025    public interface BOMConstants {
026    
027        /** UTF-8 BOM: EF BB BF */
028        public final static BOM UTF8_BOM = new BOM(new byte[]{(byte)0xEF, (byte)0xBB, (byte)0xBF}, "UTF-8");
029    
030        /** UTF-16 Big Endian BOM: FE FF */
031        public final static BOM UTF16_BE_BOM = new BOM(new byte[]{(byte)0xFE, (byte)0xFF}, "UTF-16BE");
032    
033        /** UTF-16 Little Endian BOM: FF FE */
034        public final static BOM UTF16_LE_BOM = new BOM(new byte[]{(byte)0xFF, (byte)0xFE}, "UTF-16LE");
035    
036        /** UTF-32 Big Endian BOM: 00 00 FE FF. Note that  */
037        public final static BOM UTF32_BE_BOM = new BOM(new byte[]{(byte)0x00, (byte)0x00, (byte)0xFE, (byte)0xFF}, "UTF-32BE");
038    
039        /** UTF-32 Little Endian BOM: FF FE 00 00 */
040        public final static BOM UTF32_LE_BOM = new BOM(new byte[]{(byte)0xFF, (byte)0xFE, (byte)0x00, (byte)0x00}, "UTF-32LE");
041    
042        /** List of supported BOMs */
043        final static BOM SUPPORTED_BOMS[] = new BOM[] {
044            UTF8_BOM,
045            UTF16_BE_BOM,
046            UTF16_LE_BOM,
047            UTF32_BE_BOM,
048            UTF32_LE_BOM
049        };
050    }