Remove seek support from streams

This commit is contained in:
topjohnwu
2024-02-28 11:07:53 -08:00
parent 987e5f5413
commit 625a1d6f44
9 changed files with 56 additions and 114 deletions
+2 -2
View File
@@ -16,14 +16,14 @@ using namespace std;
#define SHA_DIGEST_SIZE 20
static void decompress(format_t type, int fd, const void *in, size_t size) {
auto ptr = get_decoder(type, make_unique<fd_channel>(fd));
auto ptr = get_decoder(type, make_unique<fd_stream>(fd));
ptr->write(in, size);
}
static off_t compress(format_t type, int fd, const void *in, size_t size) {
auto prev = lseek(fd, 0, SEEK_CUR);
{
auto strm = get_encoder(type, make_unique<fd_channel>(fd));
auto strm = get_encoder(type, make_unique<fd_stream>(fd));
strm->write(in, size);
}
auto now = lseek(fd, 0, SEEK_CUR);