Class ByteOrderMarkReader

java.lang.Object
com.dd.plist.ByteOrderMarkReader

class ByteOrderMarkReader extends Object
Reads Byte Order Marks for various Unicode encodings.
  • Field Details

    • BOMs

      private static final int[][] BOMs
    • Charsets

      private static final String[] Charsets
    • charsetPossible

      private final boolean[] charsetPossible
    • offset

      private int offset
    • charset

      private String charset
  • Constructor Details

    • ByteOrderMarkReader

      ByteOrderMarkReader()
  • Method Details

    • getDetectedCharset

      public String getDetectedCharset()
      Gets the charset that was detected.
      Returns:
      The name of the detected charset, or null if no charset was detected.
    • readByte

      public boolean readByte(int b)
      Processes a byte that was read from the input.
      Parameters:
      b - The byte to process.
      Returns:
      true if the input so far could potentially be a BOM; otherwise, false.
    • detect

      public static String detect(byte[] bytes)
      Detects the encoding of input data that is available as a complete byte array.
      Parameters:
      bytes - The input data.
      Returns:
      The name of the detected charset, or null if no BOM was detected.