1/* 2 * Copyright 2008, J��r��me Duval. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7#include "IStreamWrapper.h" 8 9IStreamWrapper::IStreamWrapper(const char *filename, BPositionIO *stream) 10 : IStream(filename), 11 fStream(stream, 2048) 12{ 13} 14 15 16IStreamWrapper::~IStreamWrapper() 17{ 18} 19 20 21bool 22IStreamWrapper::read(char c[/*n*/], int n) 23{ 24 int actual = fStream.Read(c, n); 25 if (actual < B_OK) { 26 27 } 28 return (actual == n); 29} 30 31 32Int64 33IStreamWrapper::tellg() 34{ 35 return fStream.Position(); 36} 37 38 39void 40IStreamWrapper::seekg(Int64 pos) 41{ 42 fStream.Seek(pos, SEEK_SET); 43} 44