Пример #1
0
        public virtual void WriteFile(string fileName, BitArray data)
        {
            ToBegin();
            byte[] nameBytes = BitByte.BytesFromString(fileName);
            WriteDataInContainer(BitByte.BitsFromInt(nameBytes.Length));
            BitArray array = BitByte.BytesToBits(nameBytes);

            WriteDataInContainer(BitByte.BytesToBits(nameBytes));
            WriteDataInContainer(BitByte.BitsFromInt(data.Length / 8 + (data.Length % 8 == 0 ? 0 : 1)));
            WriteDataInContainer(data);
        }
Пример #2
0
        public virtual void WritePicture(string fileName, BitArray data)
        {
            PixelPicture original = writerReader.GetContainer();

            picture = new PixelPicture(new Bitmap(original.GetPicture()));
            writerReader.GetBlock().SetContainer(picture);
            FillPicture();
            ToBegin();
            byte[] nameBytes = BitByte.BytesFromString(fileName);
            WriteDataInContainer(BitByte.BitsFromInt(nameBytes.Length));
            BitArray array = BitByte.BytesToBits(nameBytes);

            WriteDataInContainer(BitByte.BytesToBits(nameBytes));
            WriteDataInContainer(BitByte.BitsFromInt(data.Length / 8 + (data.Length % 8 == 0 ? 0 : 1)));
            WriteDataInContainer(data);
            writerReader.GetBlock().SetContainer(original);
        }