import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
import net.mograsim.machine.mi.parameters.MicroInstructionParameter;
import net.mograsim.machine.mi.parameters.ParameterClassification;
*/
public static void parseMemory(final MicroInstructionMemory memory, InputStream input) throws IOException
{
- try (BufferedReader reader = new BufferedReader(new InputStreamReader(input)))
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8)))
{
MicroInstructionMemoryDefinition def = memory.getDefinition();
MicroInstructionDefinition miDef = def.getMicroInstructionDefinition();
}
catch (Exception e)
{
- throw new MicroInstructionMemoryParseException(e.getCause());
+ throw new MicroInstructionMemoryParseException(e);
}
}
int val = instStream.read();
if (val == -1 && instIndex <= maxAddress)
{
- instStream = new ByteArrayInputStream((toCSV(memory.getCell(instIndex++)) + lineSeparator).getBytes());
+ instStream = new ByteArrayInputStream(
+ (toCSV(memory.getCell(instIndex++)) + lineSeparator).getBytes(StandardCharsets.UTF_8));
val = instStream.read();
}
return val;