Search in sources :

Example 1 with FileStream

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();
        }
    }
}
Also used : FileStream(cli.System.IO.FileStream) BinaryReader(cli.System.IO.BinaryReader)

Aggregations

BinaryReader (cli.System.IO.BinaryReader)1 FileStream (cli.System.IO.FileStream)1