public FileHandleDataSource(PhpStream handle, int flength) { this.handle = handle; this.flength = flength; //TODO : Replace memorystream with a better reading/seeking class PhpBytes data; if (flength > 0) { data = handle.ReadBytes(flength); } else { data = handle.ReadBinaryContents(-1); } this.m_ms = new MemoryStream(data.ReadonlyData); }