java - 从 ByteBuffer 读取特殊的 UTF-8 字符
问题描述
如何从 ByteBuffer 中读取特殊字符?ByteBuffer.wrap("\u0001".getBytes()).asCharBuffer().get()
抛出BufferUnderflow
异常。据我所知ByteBuffer.getChar()
,总是前进两个字节,而这个字符串中只有一个字节。
解决方案
推荐阅读
- c# - System.Data.OleDb.OleDbException: 'UPDATE 语句中的语法错误。'
- php - 从 Laravel 中的存储过程列中动态显示包含列的 HTML 表
- python - 如何接受 math.exp 作为输入并将其用于 python 中的计算?
- reactjs - 在聊天应用程序的可逆滚动视图中添加项目 - 反应原生
- android - 如何处理 REST API 中的机器人
- bash - 将html消息作为shell脚本中的参数传递
- c# - Enumerator 的实现如何在 Linked List 类中工作?
- javascript - 为什么即使 Google Inspect 没有显示错误,.onclick 也不能在这种形式下工作?
- git - 如何以编程方式检测 master 中不正确(未重新设置)的合并气泡?
- python - VSCodium - 无法配置 Python 支持