Is there a Binary data type ? 
Author Message
 Is there a Binary data type ?

Hi guys

I would like to know if there is a binary data type for storing byte arrays
instead of using a byte array.

I would like following methods and properties:
ToString                Convert the internal byte array in a HEX string
SaveToFile            Save binary data to file
LoadFromFile        Load binary data from a file
Length                    How many bytes it contains
Data                       Return the internal byte array
SetByte                  Set the byte at a defined position
GetByte
....

Is there such an object in .NET or something similar ?
Do I need to create my own ?

Thanks



Sat, 01 Nov 2003 17:34:14 GMT  
 Is there a Binary data type ?
Pizzi,

<<
I would like to know if there is a binary data type for storing byte arrays
instead of using a byte array.

I would like following methods and properties:
ToString                Convert the internal byte array in a HEX string
SaveToFile            Save binary data to file
LoadFromFile        Load binary data from a file
Length                    How many bytes it contains
Data                       Return the internal byte array
SetByte                  Set the byte at a defined position
GetByte
...

Is there such an object in .NET or something similar ?
Do I need to create my own ?

You'll have to create your own. Your class shouldn't exceed 50-100 lines of
code to get the functionality you list.

Malcolm Stewart
Microsoft Beta Technical Support



Sat, 01 Nov 2003 23:54:58 GMT  
 Is there a Binary data type ?
Take a look at the MemoryStream class in System.IO.

It is not an array, but it is a structure used for working with and managing
a stream of bytes, that has a lot of the functionality you appear to be
after.

Rocky

--
Rockford Lhotka


Quote:
> Hi guys

> I would like to know if there is a binary data type for storing byte
arrays
> instead of using a byte array.

> I would like following methods and properties:
> ToString                Convert the internal byte array in a HEX string
> SaveToFile            Save binary data to file
> LoadFromFile        Load binary data from a file
> Length                    How many bytes it contains
> Data                       Return the internal byte array
> SetByte                  Set the byte at a defined position
> GetByte
> ....

> Is there such an object in .NET or something similar ?
> Do I need to create my own ?

> Thanks



Mon, 03 Nov 2003 21:38:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Binary Data Types

2. Binary data types

3. Data Type Conversion Error with Long Binary Field -PLEASE HELP

4. binary files and user defined data types

5. Binary data types

6. Help with Binary data types using VB

7. Binary data type in VB4???

8. A Binary Data Type Question

9. Binary data types in VB?

10. Crystal and SQL Binary Data Type

11. Querying binary data types

12. Saving Binary files on the Client to the Image data type in SQL Server

 

 
Powered by phpBB® Forum Software