mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-02 01:49:59 +00:00
30 lines
683 B
Java
Executable File
30 lines
683 B
Java
Executable File
package com.bytezone.diskbrowser.applefile;
|
|
|
|
public class Charset extends AbstractFile
|
|
{
|
|
public Charset (String name, byte[] buffer)
|
|
{
|
|
super (name, buffer);
|
|
}
|
|
|
|
@Override
|
|
public String getText ()
|
|
{
|
|
StringBuilder text = new StringBuilder ();
|
|
for (int i = 0; i < buffer.length; i += 8)
|
|
{
|
|
for (int line = 7; line >= 0; line--)
|
|
{
|
|
int value = buffer[i + line] & 0xFF;
|
|
for (int bit = 0; bit < 8; bit++)
|
|
{
|
|
text.append ((value & 0x01) == 1 ? "X" : ".");
|
|
value >>= 1;
|
|
}
|
|
text.append ("\n");
|
|
}
|
|
text.append ("\n");
|
|
}
|
|
return text.toString ();
|
|
}
|
|
} |