Ok. My question is confusing, but what im asking is how could i create my own file with my own encoding representing data. sorta like my own database file with my own encoding ,headers, and info.
That's easy: you write down what the rules of your encoding are. Done. You have created an encoding. All you need is a pen and some paper. Actually, the paper is optional: Ken Thompson created UTF-8 on a placemat in a diner in a single evening. Actually, even the pen is optional, too: I designed a text file format for campfire song lead sheets entirely in my head. The file format specification still exists only in my head, it was never written down anywhere nor was it ever implemented. It's pretty useless, since nobody except me knows about it, but still, it exists, and I created it in about 1.5 hours.
If you want anyone to take your encoding seriously, you'll have to implement it. Even better would be if you use this implementation in a large and complex system and show that it works, performs well, and scales.
Having a written specification in a formal language and a conformance test suite also helps foster alternative implementations and competition.
An important bit of advice is to keep it simple: the specification for Open OfficeXML (the ECMA/ISO standard based on Microsoft Office's XML file format and competitor to the OpenDocument format aka OpenOffice XML) is over 6500 pages, and to this day, no office application, not even Microsoft Office implements it fully. In fact, it cannot be fully implemented because it is logically inconsistent and contradicts itself. Don't fall into the same trap!