@@ -5,7 +5,7 @@ import java.nio.channels.FileChannel
5
5
import java .nio .file .{Files , Paths , StandardCopyOption }
6
6
7
7
import org .apache .commons .io .IOUtils
8
- import com .google .common .io .{ LittleEndianDataInputStream => DataInputStream }
8
+ import com .google .common .io .LittleEndianDataInputStream
9
9
import com .scalableminds .webknossos .wrap .util .ExtendedMappedByteBuffer
10
10
import com .scalableminds .webknossos .wrap .util .{BoxImplicits , ResourceBox }
11
11
import net .jpountz .lz4 .LZ4Factory
@@ -207,7 +207,7 @@ class WKWFile(val header: WKWHeader, fileMode: FileMode.Value, underlyingFile: R
207
207
val sourceBlockLengths = if (header.isCompressed) {
208
208
header.jumpTable.sliding(2 ).map(a => (a(1 ) - a(0 )).toInt)
209
209
} else {
210
- Array .fill(header.numBlocksPerCube)(header.numBytesPerBlock).toIterator
210
+ Array .fill(header.numBlocksPerCube)(header.numBytesPerBlock).iterator
211
211
}
212
212
213
213
val targetBlockLengths = sourceBlockLengths.foldLeft[Box [Seq [Int ]]](Full (Seq .empty)) {
@@ -279,7 +279,7 @@ object WKWFile extends WKWCompressionHelper {
279
279
}
280
280
281
281
def read [T ](is : InputStream )(f : (WKWHeader , Iterator [Array [Byte ]]) => T ): Box [T ] = {
282
- ResourceBox .manage(new DataInputStream (is)) { dataStream =>
282
+ ResourceBox .manage(new LittleEndianDataInputStream (is)) { dataStream =>
283
283
for {
284
284
header <- WKWHeader (dataStream, readJumpTable = true )
285
285
} yield {
@@ -297,7 +297,7 @@ object WKWFile extends WKWCompressionHelper {
297
297
(0 until header.numBlocksPerCube).foldLeft[Box [Array [Int ]]](Full (Array .emptyIntArray)) {
298
298
case (Full (blockLengths), _) =>
299
299
if (blocks.hasNext) {
300
- val data = blocks.next
300
+ val data = blocks.next()
301
301
for {
302
302
_ <- (data.length == header.numBytesPerBlock) ?~! error(" Unexpected block size" , header.numBytesPerBlock, data.length)
303
303
compressedBlock <- if (header.isCompressed) compressBlock(header.blockType)(data) else Full (data)
0 commit comments