How to save and read image as text, embedded in the code
<p>I know this is a strange question but I really need this to work.
I have a very small <code>.png</code> image, I need to import ("type it") it into a java source file without reading from the file system. (At least not when the program runs, I can read the image on the system with other dummy applications to parse is in binary or I don't know what else).</p>

<p>In other words, I literally need lines of code that represent the image, which I will only put there once (I don't need to import on the fly, I just type it and leave it there forever).</p>

<p>The image needs to be stored as an <code>ImageIcon</code> and, since you can type out byte arrays, I don't see why it wouldn't be possible to create a little jar that reads the image, prints the byte array to a .txt file, that I can then copy and put into the source file. I just don't know how to do these steps exactly.</p>

<p><strong>NOTE:</strong> 
I know this <em>is <strong>not</em></strong> something one would or should do, it's for a specific project and I need it done this way, the reasons go beyond me.</p>

<p><strong>NOTE 2:</strong> 
I cannot use any external lib or dependency. </p>