diff --git a/src/utils/bedFile/bedFile.cpp b/src/utils/bedFile/bedFile.cpp index a7c5886fb9ead803baa218944ae92f719c5f8966..970be657a704db220ae93fc9a76308bf782cdde0 100644 --- a/src/utils/bedFile/bedFile.cpp +++ b/src/utils/bedFile/bedFile.cpp @@ -146,6 +146,16 @@ void BedFile::Open(void) { } } +// Rewind the pointer back to the beginning of the file +void BedFile::Rewind(void) { + _bedStream->seekg(0, ios::beg); +} + +// Jump to a specific byte in the file +void BedFile::Seek(unsigned long offset) { + _bedStream->seekg(offset); +} + // Close the BED file void BedFile::Close(void) { diff --git a/src/utils/bedFile/bedFile.h b/src/utils/bedFile/bedFile.h index 7ff83245d361401e0f338a9aa5056bb4e6ea0392..71afd096d16b96458986842b34bc6081da4fa499 100644 --- a/src/utils/bedFile/bedFile.h +++ b/src/utils/bedFile/bedFile.h @@ -401,6 +401,12 @@ public: // Open a BED file for reading (creates an istream pointer) void Open(void); + + // Rewind the pointer back to the beginning of the file + void Rewind(void); + + // Jump to a specific byte in the file + void Seek(unsigned long offset); // Close an opened BED file. void Close(void);