#include "stream.h"
int main(int argc, char** args)
{
u64 fileLength = 0;
get_size( args[1], &fileLength );
u8* fileData = new u8[fileLength];
read_file( args[1], fileData, fileLength );
//Add Here
Stream s( fileData, fileLength, LittleEndian );
s.ReadInt32();
s.ReadInt16();
s.ReadInt64();
s.ReadCString();
s.Read( 1000 ); //read 1000 bytes
s.ReadByte();
s.writeInt32(3);
...
...
}
u8* Stream::ReadBytes(int count)
{
u64 lpos = this->position;
this->AdvPosition(count);
return &this->buffer[lpos];
}
#include "stream.h"
int main(int argc, char** args)
{
u64 fileLength = 0;
get_size( args[1], &fileLength );
u8* fileData = new u8[fileLength];
read_file( args[1], fileData, fileLength );
//Add Here
Stream s( fileData, fileLength, LittleEndian );
s.ReadInt32();
s.ReadInt16();
s.ReadInt64();
s.ReadCString();
s.Read( 1000 ); //read 1000 bytes
s.ReadByte();
s.writeInt32(3);
...
...
}
u8* Stream::ReadBytes(int count)
{
this->AdvPosition(count);
return &this->buffer[this->position];
}
Copyright © 2024, NextGenUpdate.
All Rights Reserved.