use of cli.System.IO.FileStream in project playn by threerings.
the class IOSAssets method getBytesSync.
@Override
public byte[] getBytesSync(String path) throws Exception {
String fullPath = resolvePath(path);
// platform.log().debug("Loading bytes " + fullPath);
BinaryReader reader = null;
try {
FileStream stream = new FileStream(fullPath, FileMode.wrap(FileMode.Open), FileAccess.wrap(FileAccess.Read), FileShare.wrap(FileShare.Read));
reader = new BinaryReader(stream);
return reader.ReadBytes((int) stream.get_Length());
} finally {
if (reader != null) {
reader.Close();
}
}
}
Aggregations