Java是否有获取各种字节顺序标记的方法?

编程入门 行业动态 更新时间:2024-10-28 06:32:19
本文介绍了Java是否有获取各种字节顺序标记的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在Java中寻找一个实用程序方法或常量,它将返回与编码的相应字节顺序标记相对应的字节,但我似乎无法找到它。有吗?我真的想做类似的事情:

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:

byte[] bom = Charset.forName( CharEncoding.UTF8 ).getByteOrderMark();

其中 CharEncoding 来自Apache Commons。

Where CharEncoding comes from Apache Commons.

推荐答案

Apache Commons IO包含您要查找的内容,请参阅 org.apachemons.io.ByteOrderMark 。

Apache Commons IO contains what you are looking for, see org.apachemons.io.ByteOrderMark.

更多推荐

Java是否有获取各种字节顺序标记的方法?

本文发布于:2023-11-03 19:50:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555933.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字节   标记   顺序   方法   Java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!