WriteBytes ?

BlitzMax Forums/BlitzMax Programming/WriteBytes ?

Hi :)

I'm looking under module code stream and i see a writebytes()
method, the question is :

It is possible to use bank with this method ? because when i try
to do this with bank my output file are corrupted ?

Is see in the code

WriteBytes( buf:Byte Ptr,count )

The forst arg is Byte ? not TBank ? it is normal ?

exemple don"t work :

Local CurrentPakFile:TStream=ReadStream(Pakname)
Local Tmp_CompressSize:Int=200000
Local SourceBank:TBank

SourceBank=TBank.Create(Tmp_CompressSize)
CurrentPakFile.Writebytes(SourceBank,Tmp_CompressSize)

If i want do do the same, wihout bug, i must use my hown writebytes function :

Function MPK_WriteBytes(File:TStream,Bank:TBank)
For Local I=0 To BankSize(Bank)-1
WriteByte(File,PeekByte(Bank,i))
Next
End Function