IntPtr initial_pointer;
long initial_position;
long current_position;
-#if NET_4_0 || MOBILE
+#if NET_4_0
SafeBuffer safebuffer;
#endif
Initialize (pointer, length, capacity, access);
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
public UnmanagedMemoryStream (SafeBuffer buffer, long offset, long length) :
this (buffer, offset, length, FileAccess.Read)
{
[CLSCompliantAttribute (false)]
public unsafe byte* PositionPointer {
get {
-#if NET_4_0 || MOBILE
+#if NET_4_0
if (safebuffer != null)
throw new NotSupportedException ("Not supported when using SafeBuffer");
#endif
return (byte *) initial_pointer + current_position;
}
set {
-#if NET_4_0 || MOBILE
+#if NET_4_0
if (safebuffer != null)
throw new NotSupportedException ("Not supported when using SafeBuffer");
#endif
return 0;
int progress = current_position + count < length ? count : (int) (length - current_position);
-#if NET_4_0 || MOBILE
+#if NET_4_0
if (safebuffer != null) {
unsafe {
byte *ptr = null;
if (current_position >= length)
return (-1);
-#if NET_4_0 || MOBILE
+#if NET_4_0
if (safebuffer != null) {
unsafe {
byte *ptr = null;
public override void SetLength (long value)
{
-#if NET_4_0 || MOBILE
+#if NET_4_0
if (safebuffer != null)
throw new NotSupportedException ("Not supported when using SafeBuffer");
#endif
if (fileaccess == FileAccess.Read)
throw new NotSupportedException ("Stream does not support writing.");
-#if NET_4_0 || MOBILE
+#if NET_4_0
if (safebuffer != null) {
unsafe {
byte *dest = null;
if (fileaccess == FileAccess.Read)
throw new NotSupportedException("Stream does not support writing.");
-#if NET_4_0 || MOBILE
+#if NET_4_0
if (safebuffer != null) {
unsafe {
byte *dest = null;
closed = false;
}
-#if NET_4_0 || MOBILE
+#if NET_4_0
protected void Initialize (SafeBuffer buffer, long offset, long length, FileAccess access)
{
if (buffer == null)