Skip to content

Commit 60f60d6

Browse files
committed
Add a method to expose whether the stream is positioned at the end of a BGZF block.
1 parent 2df50c2 commit 60f60d6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/java/htsjdk/samtools/util/BlockCompressedInputStream.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ public int available()
132132
return mCurrentBlock.length - mCurrentOffset;
133133
}
134134

135+
/**
136+
* @return <code>true</code> if the stream is at the end of a BGZF block,
137+
* <code>false</code> otherwise.
138+
*/
139+
public boolean endOfBlock() {
140+
return (mCurrentBlock != null && mCurrentOffset == mCurrentBlock.length);
141+
}
142+
135143
/**
136144
* Closes the underlying InputStream or RandomAccessFile
137145
*/

0 commit comments

Comments
 (0)