fixing up data store stuff

This commit is contained in:
Grant Limberg 2015-05-23 18:29:16 -07:00
parent 5c2aaad365
commit 6e998efd15
3 changed files with 9 additions and 6 deletions

View File

@ -6,25 +6,28 @@ import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import android.content.Context; import android.content.Context;
import android.util.Log;
public class AndroidFileProvider implements DataStoreFileProvider { public class AndroidFileProvider implements DataStoreFileProvider {
private static final String TAG = "AndroidFileProvider";
Context _ctx; Context _ctx;
AndroidFileProvider(Context ctx) { public AndroidFileProvider(Context ctx) {
this._ctx = ctx; this._ctx = ctx;
} }
@Override @Override
public FileInputStream getInputFileStream(String name) public FileInputStream getInputFileStream(String name)
throws FileNotFoundException { throws FileNotFoundException {
// TODO Auto-generated method stub Log.d(TAG, "Returning FileInputStream for: " + name);
return _ctx.openFileInput(name); return _ctx.openFileInput(name);
} }
@Override @Override
public FileOutputStream getOutputFileStream(String name) public FileOutputStream getOutputFileStream(String name)
throws FileNotFoundException { throws FileNotFoundException {
// TODO Auto-generated method stub Log.d(TAG, "Returning FileOutputStream for: " + name);
return _ctx.openFileOutput(name, Context.MODE_PRIVATE); return _ctx.openFileOutput(name, Context.MODE_PRIVATE);
} }

View File

@ -12,7 +12,7 @@ public class DataStore implements DataStoreGetListener, DataStorePutListener {
private DataStoreFileProvider _provider; private DataStoreFileProvider _provider;
DataStore(DataStoreFileProvider provider) { public DataStore(DataStoreFileProvider provider) {
this._provider = provider; this._provider = provider;
} }
@ -23,7 +23,7 @@ public class DataStore implements DataStoreGetListener, DataStorePutListener {
FileOutputStream fos = _provider.getOutputFileStream(name); FileOutputStream fos = _provider.getOutputFileStream(name);
fos.write(buffer); fos.write(buffer);
fos.close(); fos.close();
return buffer.length; return 0;
} catch (FileNotFoundException fnf) { } catch (FileNotFoundException fnf) {
fnf.printStackTrace(); fnf.printStackTrace();
return -1; return -1;

View File

@ -38,7 +38,7 @@ public interface VirtualNetworkFrameListener {
* @param vlanId * @param vlanId
* @param frameData data to send * @param frameData data to send
*/ */
void onVirtualNetworkFrame( public void onVirtualNetworkFrame(
long nwid, long nwid,
long srcMac, long srcMac,
long destMac, long destMac,