Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#β€’4y agoβ€’
48 replies
Temporal Nightmare

BinaryReader Question

Trying to read the values AS bytes, but reader reads them as decimals, is there a trick to making it bytes?

        private void ReadArenaDefs(string arenaSlotNumber)
        {
            string fileName = @$"{AppDomain.CurrentDomain.BaseDirectory}\ArenaDefinition_00505.jsfb";
            
            byte[] bytesCrowdType = new byte[8];
            int offset = 288;

            if (File.Exists(fileName)) 
            {
                using (BinaryReader reader = new BinaryReader(new FileStream(fileName, FileMode.Open)))
                {
                    reader.BaseStream.Seek(offset, SeekOrigin.Begin);
                    reader.Read(bytesCrowdType, 0, 8);          
                }    
            }  
        }
        private void ReadArenaDefs(string arenaSlotNumber)
        {
            string fileName = @$"{AppDomain.CurrentDomain.BaseDirectory}\ArenaDefinition_00505.jsfb";
            
            byte[] bytesCrowdType = new byte[8];
            int offset = 288;

            if (File.Exists(fileName)) 
            {
                using (BinaryReader reader = new BinaryReader(new FileStream(fileName, FileMode.Open)))
                {
                    reader.BaseStream.Seek(offset, SeekOrigin.Begin);
                    reader.Read(bytesCrowdType, 0, 8);          
                }    
            }  
        }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Reading from ClientWebSocket with BinaryReader
C#CC# / help
3y ago
BinaryReader and BinaryWriter api behaviour incompatibility
C#CC# / help
4y ago
βœ…BinaryReader reads garbage when reading from compressed stream
C#CC# / help
6mo ago
❔ QuestionController
C#CC# / help
3y ago