Skip to content
Snippets Groups Projects
Commit c75b70e8 authored by Vojtěch Moravec's avatar Vojtěch Moravec
Browse files

Fix build for Java8.

TODO: Implement the functions, which are now commented out.
parent 789f9ff3
Branches
No related tags found
No related merge requests found
......@@ -110,7 +110,8 @@ public class CacheFileHeader {
}
byte[] magicBuffer = new byte[QCMP_CACHE_MAGIC_VALUE.length()];
final int readFromMagic = inputStream.readNBytes(magicBuffer, 0, QCMP_CACHE_MAGIC_VALUE.length());
final int readFromMagic = inputStream.read(magicBuffer,0,QCMP_CACHE_MAGIC_VALUE.length());
if (readFromMagic != QCMP_CACHE_MAGIC_VALUE.length()) {
throw new IOException("Invalid file type. Unable to read magic value");
}
......@@ -123,7 +124,8 @@ public class CacheFileHeader {
trainFileNameSize = inputStream.readUnsignedShort();
byte[] fileNameBuffer = new byte[trainFileNameSize];
inputStream.readNBytes(fileNameBuffer, 0, trainFileNameSize);
inputStream.read(fileNameBuffer,0, trainFileNameSize);
// inputStream.readNBytes(fileNameBuffer, 0, trainFileNameSize);
trainFileName = new String(fileNameBuffer);
vectorSizeX = inputStream.readUnsignedShort();
......
......@@ -86,7 +86,7 @@ public class QCMPFileHeader {
}
byte[] magicBuffer = new byte[QCMP_MAGIC_VALUE.length()];
final int readFromMagic = inputStream.readNBytes(magicBuffer, 0, QCMP_MAGIC_VALUE.length());
final int readFromMagic = inputStream.read(magicBuffer, 0, QCMP_MAGIC_VALUE.length());
if (readFromMagic != QCMP_MAGIC_VALUE.length()) {
// Invalid magic value.
return false;
......
......@@ -61,12 +61,13 @@ public class Stopwatch {
if (elapsed == null) {
return "No time measured yet.";
}
return String.format("%dH %dmin %dsec %dms %dns",
elapsed.toHoursPart(),
elapsed.toMinutesPart(),
elapsed.toSecondsPart(),
elapsed.toMillisPart(),
elapsed.toNanosPart());
return null;
// return String.format("%dH %dmin %dsec %dms %dns",
// elapsed.toHoursPart(),
// elapsed.toMinutesPart(),
// elapsed.toSecondsPart(),
// elapsed.toMillisPart(),
// elapsed.toNanosPart());
}
......
......@@ -18,7 +18,8 @@ public class Utils {
public static byte[] readFileBytes(final String path) throws FileNotFoundException {
FileInputStream fileStream = new FileInputStream(path);
try {
return fileStream.readAllBytes();
throw new FileNotFoundException("Implement this actually!");
// return fileStream.readAllBytes();
} catch (IOException e) {
e.printStackTrace();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment