15,913,685 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Majd ROG (Top 7 by date)
Majd ROG
28-Dec-14 6:30am
View
Thank you bill, it's work for me, but please i just need a one thing to edit.. can you help me ??
Majd ROG
20-Dec-14 17:29pm
View
Thank you so much @Billwoodruff, this is a great work from you..
I'll try and i'll keep in touch with you.
Just a question, if i dealing with large file like 20,50Mb maybe 100Mb? can i use i MemoryStream Byte-After-Byte?? to make no issues ??
or i must search for a better than MemoryStream BitArray??
Majd ROG
20-Dec-14 15:43pm
View
Thank you so much @BillWoodruff for your help, i'll try in a few hours the code you gave me, just a question, i'll use inside my MemoryStream code, System.Collections.BitArray code you gave me, so MemoryStream read 1 byte then
i'll use your code to convert the 1 byte to array of 8 bits each time.
i think this is good. right? i'll try and let you know.. thank you so much again
Majd ROG
20-Dec-14 7:26am
View
Thank you @BillWoodruff for your assist, actually you'r true..
As you say.. i need to use the 2nd code. using "MemoryStream" to read a file into an Array of Bytes.. then i create a for loop to file length byte after byte.
BUT MY PROBLEM WITH THE SECOND CODE IS.. the code gave me a byte in decimal..
And all of what i need is to want to access to the access the values of the bits in each Byte in that array .. bits after bits ..
string path = openFileDialog1.FileName;
byte[] file = File.ReadAllBytes(path);
MemoryStream memory = new MemoryStream(file);
BinaryReader reader = new BinaryReader(memory);
for (int i = 0; i < file.Length; i++)
{
byte result = reader.ReadByte();
//THIS CODE GIVES ME A ONE BYTE EACH TIME BUT IN DECIMAL !!!!!!
//I NEED TO ACCESS THE BITS IN EACH BYTE LIKE THAT "0,1,1,0,0,0,0,1"
//ACCESS TO INDEX [0] = 0
//Index [1] = 1
}
This code i need to use but i just need to edit the code, so i can read byte after byte but in binary, NOT IN DECIMAL, then.. access to the 8 bits in the 1 byte!
Majd ROG
20-Dec-14 7:17am
View
Thank you @BillWoodruff for your assist, actually you'r true..
As you say.. i need to use the 2nd code. using "MemoryStream" to read a file into an Array of Bytes.. then i create a for loop to file length byte after byte.
BUT MY PROBLEM WITH THE SECOND CODE IS.. the code gave me a byte in decimal..
And all of what i need is to want to access to the access the values of the bits in each Byte in that array .. bits after bits .. by using this code..
string path = openFileDialog1.FileName;
byte[] file = File.ReadAllBytes(path);
MemoryStream memory = new MemoryStream(file);
BinaryReader reader = new BinaryReader(memory);
for (int i = 0; i < file.Length; i++)
{
byte result = reader.ReadByte();
//THIS CODE GIVES ME A ONE BYTE EACH TIME BUT IN DECIMAL !!!!!!
//I NEED TO ACCESS THE BITS IN EACH BYTE LIKE THAT "0,1,1,0,0,0,0,1"
//ACCESS TO INDEX [0] = 0
//Index [1] = 1
}
Majd ROG
19-Dec-14 23:08pm
View
Ok,,
I need someone to edit the 2nd code (using MemoryStream) to read an file in binary 0,1,0,0,1,0,0,1 etc.. to the end of file..
but the binary values isn't integer!! i need that values in array of string so i can compare the index of the for loop with it..
For ex..
for (int i = 0; i <= BinaryArray.Length -1 ; i+=2)
{
if (BinaryArray[i] == "0")
{
do something..
}
else if (BinaryArray[i] == "1")
{
do something else..
}
so. i need to edit the 2nd code my question.. because when i use it i got an decimal value.. and i need a binary!!
sorry but i'm trying to be clear, and i hope so..
Majd ROG
19-Dec-14 19:50pm
View
Hello, what i mean in that.. i have a 1 byte for ex..
And i need to make an 8 index's array of 0 1 string
if i look into array index [0],, i want to see the 0 bit for ex..
0,1,1,0,1,0,1,0
So.. @ the final thing if i have 100 bytes file..
After i convert it to binary array.. i must got 100x8 bit.. so that will be 800 byte
>>>>>>
On other way.. i need to read the file bits 0,1.. and each bit in single index
not 8 bit (1 byte in 1 index..) NO NO!
Show More