Skip to content

Commit fcb7b2f

Browse files
committed
Change return type of KaitaiStream.pos() to long
1 parent eb20592 commit fcb7b2f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/main/java/io/kaitai/struct/ByteBufferKaitaiStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public void seek(long newPos) {
191191
}
192192

193193
@Override
194-
public int pos() {
194+
public long pos() {
195195
return bb.position();
196196
}
197197

src/main/java/io/kaitai/struct/KaitaiStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public abstract class KaitaiStream implements Closeable {
112112
* Get current position of a stream pointer.
113113
* @return pointer position, number of bytes from the beginning of the stream
114114
*/
115-
abstract public int pos();
115+
abstract public long pos();
116116

117117
/**
118118
* Get total size of the stream in bytes.

src/main/java/io/kaitai/struct/RandomAccessFileKaitaiStream.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015-2019 Kaitai Project: MIT license
2+
* Copyright 2015-2020 Kaitai Project: MIT license
33
*
44
* Permission is hereby granted, free of charge, to any person obtaining
55
* a copy of this software and associated documentation files (the
@@ -85,10 +85,9 @@ public void seek(long newPos) {
8585
}
8686

8787
@Override
88-
public int pos() {
88+
public long pos() {
8989
try {
90-
// FIXME cast
91-
return (int) raf.getFilePointer();
90+
return raf.getFilePointer();
9291
} catch (IOException e) {
9392
throw new RuntimeException(e);
9493
}

0 commit comments

Comments
 (0)