Skip to content

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

Open
@wessankey

Description

@wessankey

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions