Charset做的ByteBuffer.asCharBuffer()使用什么? [英] What Charset does ByteBuffer.asCharBuffer() use?

查看:452
本文介绍了Charset做的ByteBuffer.asCharBuffer()使用什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Charset的功能 ByteBuffer .asCharBuffer()使用?它似乎在我的系统上将3个字节转换为一个字符。

What Charset does ByteBuffer.asCharBuffer() use? It seems to convert 3 bytes to one character on my system.

在相关的说明中, CharsetDecoder 与ByteBuffer.asCharBuffer()有关?

On a related note, how does CharsetDecoder relate to ByteBuffer.asCharBuffer()?

UPDATE :关于我正在使用的ByteBuffer的实现,我正在调用 ByteBuffer.allocate(1024).asCharBuffer()。我不能评论在幕后使用什么实现。

UPDATE: With respect to what implementation of ByteBuffer I am using, I am invoking ByteBuffer.allocate(1024).asCharBuffer(). I can't comment on what implementation gets used under the hood.

推荐答案

对于第一个问题 - 我认为它使用原生字符Java编码(UTF-16)。

For the first question - I believe it uses native character encoding of Java (UTF-16).

这篇关于Charset做的ByteBuffer.asCharBuffer()使用什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆