Skip to content

Commit f6773f3

Browse files
committed
Change return type of KaitaiStream.pos() to long
1 parent 35d4069 commit f6773f3

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

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

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

198198
@Override
199-
public int pos() {
199+
public long pos() {
200200
return bb.position();
201201
}
202202

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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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)