epam / epam/parso

java.io.IOException: No available bytes in the input stream

Open
#53 7 comments 0 reactions 0 assignees View on GitHub
nodataset
Dominant language
Java
Stars
79
Forks
42
PR merge metrics
No merged PRs in 30d

Description

I'm running into the following exception when attempting to process a file:

```
java.io.IOException: There are no available bytes in the input stream.
at com.epam.parso.impl.SasFileParser.getBytesFromFile(SasFileParser.java:768)
at com.epam.parso.impl.SasFileParser.readSubheaderSignature(SasFileParser.java:423)
at com.epam.parso.impl.SasFileParser.processPageMetadata(SasFileParser.java:392)
at com.epam.parso.impl.SasFileParser.processNextPage(SasFileParser.java:591)
at com.epam.parso.impl.SasFileParser.readNextPage(SasFileParser.java:561)
at com.epam.parso.impl.SasFileParser.readNext(SasFileParser.java:519)
at com.epam.parso.impl.SasFileReaderImpl.readNext(SasFileReaderImpl.java:168)
... 57 elided
```

The error occurs after processing approximately 400,000 rows, and the file has several million. My code is below:

```scala
import java.io.FileInputStream
import com.epam.parso.impl.SasFileReaderImpl

val sasFileReader = new SasFileReaderImpl(new FileInputStream("test.sas7bdat"))
int numRows = sasFileReader.getSasFileProperties().getRowCount()
int currentRowNum = 0

while (currentRowNum < numRows) {
val currentRow = sasFileReader.readNext()
currentRow.foreach(c => print(c + "|"))
currentRowNum += 1
}
```

Environment details:
I'm running this on an EMR cluster with Scala 2.11.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.