dmolony-DiskBrowser/src/com/bytezone/diskbrowser/wizardry/CodedMessage.java
2016-02-25 08:11:14 +11:00

27 lines
619 B
Java
Executable File

package com.bytezone.diskbrowser.wizardry;
import com.bytezone.diskbrowser.utilities.HexFormatter;
class CodedMessage extends Message
{
public static int codeOffset = 185;
public CodedMessage (byte[] buffer)
{
super (buffer);
}
@Override
protected String getLine (int offset)
{
int length = HexFormatter.intValue (buffer[offset]);
byte[] translation = new byte[length];
codeOffset--;
for (int j = 0; j < length; j++)
{
translation[j] = buffer[offset + 1 + j];
translation[j] -= codeOffset - j * 3;
}
return HexFormatter.getString (translation, 0, length);
}
}