- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试做一些 scripting in Scala , 处理一些日志文件:
scala> import io.Source
import io.Source
scala> import java.io.File
import java.io.File
scala> val f = new File(".")
f: java.io.File = .
scala> for (l <- f.listFiles) {
| val src = Source.fromFile(l).getLines
| println( (0 /: src) { (i, line) => i + 1 } )
| }
3658
java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Unknown Source)
at java.nio.HeapCharBuffer.get(Unknown Source)
at scala.io.BufferedSource$$anon$2.next(BufferedSource.scala:86)
at scala.io.BufferedSource$$anon$2.next(BufferedSource.scala:74)
at scala.io.Source$$anon$6.next(Source.scala:307)
at scala.io.Source$$anon$6.next(Source.scala:301)
at scala.Iterator$cla...
java.nio.BufferUnderflowException
?
最佳答案
我收到了 BufferUnderflowException
当我打开一个带有错误编码的文件时出现异常。它包含非法字符(根据错误的编码),并抛出了这个误导性异常。
关于scala - 为什么我在这个 Scala 中得到一个 java.nio.BufferUnderflowException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1048618/
我正在使用这个函数将 bytearray 转换为 int。 public static int byteArrayToInt(byte[] b) { ByteBuffer bb = ByteB
处理 4MB 日志文件时遇到了与this guy类似的问题。实际上,我正在同时处理多个文件,但是由于我不断收到此异常,因此我决定仅对单个文件进行测试: val temp = Source.fromFi
这段代码有什么问题? : ByteBuffer byteBuffer = ByteBuffer.allocate(4); FileChannel channel = cacheFile.getChan
我从以下代码中获取 BufferUnderflowException。 int length = mBuf.remaining(); char[] charBuff = new char[length
我有一个非常简单的 Java EE 应用程序,其中包含一些使用 JMS 进行通信的 bean。当我尝试部署和调试我的应用程序时,我得到了这个 Informazioni: visiting unvi
我正在获取 String 的 ByteBuffer,例如100如下 ByteBuffer data = IntegerSerializer.get().toByteBuffer(Integer.par
我对 kaitai-struct 和 java 还很陌生。我已将 .ksy 文件解析为目标语言 java,但在 eclipse ide 中编译后,我得到“java.nio.BufferUnderflo
我正在尝试编写一个程序来使用 Java nio 通过数据报 channel 发送和接收序列化对象,但在尝试从 ObjectInputStream 读取我的对象时收到 BufferUnderFlow 异
我需要将 bytearray 转换为 double。我正在使用 double dvalue = ByteBuffer.wrap(value).getDouble(); 但是在运行时我得到 Buffer
我正在尝试做一些 scripting in Scala , 处理一些日志文件: scala> import io.Source import io.Source scala> import java.
在消费者上获取此 kafka 异常: org.apache.kafka.common.protocol.types.SchemaException: Error reading field 'corr
非常小的一段代码,但我对这种行为感到非常惊讶。我有一个字节数组中的 14 字节 key 。我将这个字节数组放入 ByteBuffer,然后执行 getLong 给我一个 BufferUnderflow
9.0 客户端使用来自远程系统上运行的两个代理的消息。我的生产者工作正常并且能够向代理发送消息,但我的消费者无法使用这些消息。消费者和生产者正在我的本地系统上运行两个经纪人都在 aws 上。 每当我尝
我是一名优秀的程序员,十分优秀!