Does Java have methods to get the various byte order marks? <p>I am looking for a utility method or constant in Java that will return me the bytes that correspond to the appropriate byte order mark for an encoding, but I can't seem to find one. Is there one? I really would like to do something like:</p> <pre><code>byte[] bom = Charset.forName( CharEncoding.UTF8 ).getByteOrderMark(); </code></pre> <p>Where <code>CharEncoding</code> comes from Apache Commons.</p>