dmolony-DiskBrowser/src/com/bytezone/diskbrowser/wizardry/CodedMessage.java

27 lines
632 B
Java
Raw Normal View History

2015-06-01 09:35:51 +00:00
package com.bytezone.diskbrowser.wizardry;
2016-02-24 21:11:14 +00:00
import com.bytezone.diskbrowser.utilities.HexFormatter;
2015-06-01 09:35:51 +00:00
class CodedMessage extends Message
{
2016-12-17 22:07:55 +00:00
public static int codeOffset = 185;
2015-06-01 09:35:51 +00:00
2016-12-17 22:07:55 +00:00
public CodedMessage (byte[] buffer)
{
super (buffer);
}
2015-06-01 09:35:51 +00:00
2016-12-17 22:07:55 +00:00
@Override
protected String getLine (int offset)
{
int length = buffer[offset] & 0xFF;
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);
}
2015-06-01 09:35:51 +00:00
}