//      public int Write (byte[] buffer)
//      {
//          s.Write (buffer, 0, buffer.Length);
//          return buffer.Length;
//      }
//
//      public int Write (ByteBuffer buffer)
//      {
//          int offset = buffer.Position () + buffer.ArrayOffset ();
//          int count = (buffer.Limit () + buffer.ArrayOffset ()) - offset;
//          s.Write (buffer.Array (), offset, count);
//          buffer.Position (buffer.Position () + count);
//          return count;
//      }

        public long TransferFrom(FileChannel src, long pos, long count)
        {
            if (buffer == null)
            {
                buffer = new byte [8092];
            }
            int  nr     = src.s.Read(buffer, 0, (int)Math.Min(buffer.Length, count));
            long curPos = s.Position;

            s.Position = pos;
            s.Write(buffer, 0, nr);
            s.Position = curPos;
            return(nr);
        }
Beispiel #2
0
		public static OutputStream NewOutputStream (FileChannel c)
		{
			return c.Stream;
		}
Beispiel #3
0
 public static OutputStream NewOutputStream(FileChannel c)
 {
     return(c.Stream);
 }