6
internal class FileChannel
12
internal FileChannel (FileStream s)
18
internal FileStream Stream {
33
public void Force (bool f)
38
public MappedByteBuffer Map ()
40
throw new NotImplementedException ();
43
public MappedByteBuffer Map (MapMode mode, long pos, int size)
45
throw new NotImplementedException ();
48
public int Read (byte[] buffer)
50
return s.Read (buffer, 0, buffer.Length);
53
public int Read (ByteBuffer buffer)
55
int offset = buffer.Position () + buffer.ArrayOffset ();
56
int num2 = s.Read (buffer.Array (), offset, (buffer.Limit () + buffer.ArrayOffset ()) - offset);
57
buffer.Position (buffer.Position () + num2);
66
public FileLock TryLock ()
69
s.Lock (0, int.MaxValue);
70
return new FileLock (s);
71
} catch (IOException) {
76
public int Write (byte[] buffer)
78
s.Write (buffer, 0, buffer.Length);
82
public int Write (ByteBuffer buffer)
84
int offset = buffer.Position () + buffer.ArrayOffset ();
85
int count = (buffer.Limit () + buffer.ArrayOffset ()) - offset;
86
s.Write (buffer.Array (), offset, count);
87
buffer.Position (buffer.Position () + count);
91
public long TransferFrom (FileChannel src, long pos, long count)
94
buffer = new byte [8092];
95
int nr = src.s.Read (buffer, 0, (int) Math.Min (buffer.Length, count));
96
long curPos = s.Position;
98
s.Write (buffer, 0, nr);