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

33 lines
1.1 KiB
Java
Raw Normal View History

2020-02-11 07:29:55 +00:00
package com.bytezone.diskbrowser.wizardry;
import com.bytezone.diskbrowser.utilities.HexFormatter;
// -----------------------------------------------------------------------------------//
2022-05-28 02:59:25 +00:00
class CodedMessage extends MessageV1
2020-02-11 07:29:55 +00:00
// -----------------------------------------------------------------------------------//
{
public static int codeOffset = 185;
// ---------------------------------------------------------------------------------//
CodedMessage (byte[] buffer)
// ---------------------------------------------------------------------------------//
{
super (buffer);
}
// ---------------------------------------------------------------------------------//
@Override
protected String getLine (int offset)
// ---------------------------------------------------------------------------------//
{
2022-03-26 11:37:41 +00:00
int length = buffer[offset++] & 0xFF;
2020-02-11 07:29:55 +00:00
byte[] translation = new byte[length];
codeOffset--;
for (int j = 0; j < length; j++)
{
2022-03-26 11:37:41 +00:00
translation[j] = buffer[offset + j];
2020-02-11 07:29:55 +00:00
translation[j] -= codeOffset - j * 3;
}
return HexFormatter.getString (translation, 0, length);
}
2015-06-01 09:35:51 +00:00
}