Created
January 10, 2013 00:02
-
-
Save Dav1dde/4498174 to your computer and use it in GitHub Desktop.
This file contains 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 byte[] readBytesFromStream(DataInputStream par0DataInputStream) throws IOException | |
{ | |
short var1 = par0DataInputStream.readShort(); | |
System.out.printf("\n\nLength is: %s\n", var1); | |
if (var1 < 0) | |
{ | |
throw new IOException("Key was smaller than nothing! Weird key!"); | |
} | |
else | |
{ | |
byte[] var2 = new byte[var1]; | |
int bytes_read = par0DataInputStream.read(var2); | |
System.out.printf("Bytes read: %s\n", bytes_read); | |
return var2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment