Skip to content

Commit 5490849

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

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

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

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

194194
@Override
195-
public int pos() {
195+
public long pos() {
196196
return bb.position();
197197
}
198198

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
@@ -86,10 +86,9 @@ public void seek(long newPos) {
8686
}
8787

8888
@Override
89-
public int pos() {
89+
public long pos() {
9090
try {
91-
// FIXME cast
92-
return (int) raf.getFilePointer();
91+
return raf.getFilePointer();
9392
} catch (IOException e) {
9493
throw new RuntimeException(e);
9594
}

0 commit comments

Comments
 (0)