Last active
August 29, 2015 14:09
-
-
Save lion328/00e174cb4f4fdbecc9f2 to your computer and use it in GitHub Desktop.
NCN CUR reader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int[] readNcnCur(File f) throws IOException { | |
DataInputStream in = new DataInputStream(new FileInputStream(f)); | |
int[] out = new int[(int)Math.ceil(f.length() / 2)]; | |
int i = 0; | |
while(in.available() > 0) { | |
int temp = in.readUnsignedByte(); | |
int byte2 = in.readUnsignedByte(); | |
if(byte2 != 255) { | |
temp += byte2 << 8; | |
out[i++] = temp; | |
} | |
} | |
in.close(); | |
return out; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment