G
Guest
Hello!
I would like insert my data(who i get on my binaryreader) in an array byte.
nd after, i would like modify it and save it with my BinaryWriter this is my
code.
My file is always empty.
Thank's for your help,
Wavemill
FileStream myStream = new FileStream(@"\MyFile.bmp", FileMode.Open);
BinaryReader myReader = new BinaryReader(myStream);
FileStream myStreamWriter = new FileStream(@"\MyFile.bmp", FileMode.Create);
BinaryWriter myWriter = new BinaryWriter(myStreamWriter);
for(int i=0;i<myStreamWriter.Length;i++)
{
myBitmapByte = myReader.ReadByte();
}
//here i would like modify my array byte
I write my file
foreach (byte myByte in myBitmapByte)
{
myWriter.Write(myByte);
}
myWriter.Flush();
myStream.Close();
myReader.Close();
myStreamWriter.Close();
myWriter.Close();
I would like insert my data(who i get on my binaryreader) in an array byte.
nd after, i would like modify it and save it with my BinaryWriter this is my
code.
My file is always empty.
Thank's for your help,
Wavemill
FileStream myStream = new FileStream(@"\MyFile.bmp", FileMode.Open);
BinaryReader myReader = new BinaryReader(myStream);
FileStream myStreamWriter = new FileStream(@"\MyFile.bmp", FileMode.Create);
BinaryWriter myWriter = new BinaryWriter(myStreamWriter);
for(int i=0;i<myStreamWriter.Length;i++)
{
myBitmapByte = myReader.ReadByte();
}
//here i would like modify my array byte
I write my file
foreach (byte myByte in myBitmapByte)
{
myWriter.Write(myByte);
}
myWriter.Flush();
myStream.Close();
myReader.Close();
myStreamWriter.Close();
myWriter.Close();