2006-05-13 23:21:28 +02:00
|
|
|
// natVMChannels.cc - Native part of VMChannels class.
|
2004-03-04 00:50:03 +01:00
|
|
|
|
2006-05-13 23:21:28 +02:00
|
|
|
/* Copyright (C) 2004, 2006 Free Software Foundation
|
2004-03-04 00:50:03 +01:00
|
|
|
|
|
|
|
This file is part of libgcj.
|
|
|
|
|
|
|
|
This software is copyrighted work licensed under the terms of the
|
|
|
|
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <gcj/cni.h>
|
|
|
|
|
2006-05-13 23:21:28 +02:00
|
|
|
#include <java/nio/channels/VMChannels.h>
|
2004-03-04 00:50:03 +01:00
|
|
|
#include <java/nio/channels/Channels.h>
|
|
|
|
#include <java/io/FileInputStream.h>
|
|
|
|
#include <java/io/FileOutputStream.h>
|
|
|
|
#include <gnu/java/nio/channels/FileChannelImpl.h>
|
|
|
|
|
2006-05-13 23:21:28 +02:00
|
|
|
using java::nio::channels::VMChannels;
|
2004-03-04 00:50:03 +01:00
|
|
|
using java::io::FileInputStream;
|
|
|
|
using java::io::FileOutputStream;
|
|
|
|
using gnu::java::nio::channels::FileChannelImpl;
|
|
|
|
|
|
|
|
FileInputStream*
|
2006-05-13 23:21:28 +02:00
|
|
|
VMChannels::newInputStream(FileChannelImpl* ch)
|
2004-03-04 00:50:03 +01:00
|
|
|
{
|
|
|
|
// Needs to be native to bypass Java access protection.
|
|
|
|
return new FileInputStream (ch);
|
|
|
|
}
|
|
|
|
|
|
|
|
FileOutputStream*
|
2006-05-13 23:21:28 +02:00
|
|
|
VMChannels::newOutputStream(FileChannelImpl* ch)
|
2004-03-04 00:50:03 +01:00
|
|
|
{
|
|
|
|
// Needs to be native to bypass Java access protection.
|
|
|
|
return new FileOutputStream (ch);
|
|
|
|
}
|