Exemplo n.º 1
0
            public void CopyTo(IAreaWriter destination, int size)
            {
                const int BUFFER_SIZE = 2048;

                byte[] buf     = new byte[BUFFER_SIZE];
                int    to_copy = System.Math.Min(size, BUFFER_SIZE);

                while (to_copy > 0)
                {
                    Read(buf, 0, to_copy);
                    destination.Write(buf, 0, to_copy);
                    size   -= to_copy;
                    to_copy = System.Math.Min(size, BUFFER_SIZE);
                }
            }
Exemplo n.º 2
0
            public void CopyTo(IAreaWriter dest, int size)
            {
                // NOTE: Assuming 'destination' is a StoreArea, the temporary buffer
                // could be optimized away to a direct System.arraycopy.  However, this
                // function would need to be written as a lower level IO function.
                const int BUFFER_SIZE = 2048;
                byte[] buf = new byte[BUFFER_SIZE];
                int to_copy = System.Math.Min(size, BUFFER_SIZE);

                while (to_copy > 0) {
                    Read(buf, 0, to_copy);
                    dest.Write(buf, 0, to_copy);
                    size -= to_copy;
                    to_copy = System.Math.Min(size, BUFFER_SIZE);
                }
            }
Exemplo n.º 3
0
 public override void WriteTo(IAreaWriter area)
 {
     area.Write(data, 0, Length);
 }
Exemplo n.º 4
0
 public override void WriteTo(IAreaWriter writer)
 {
     writer.Write(buffer, 6, Length);
 }
Exemplo n.º 5
0
 public override void WriteTo(IAreaWriter area)
 {
     area.Write(data, 12, Length);
 }
Exemplo n.º 6
0
 public override void WriteTo(IAreaWriter writer)
 {
     writer.Write(data, 0, Length);
 }
Exemplo n.º 7
0
            public void CopyTo(IAreaWriter destination, int size)
            {
                const int BUFFER_SIZE = 2048;
                byte[] buf = new byte[BUFFER_SIZE];
                int to_copy = System.Math.Min(size, BUFFER_SIZE);

                while (to_copy > 0) {
                    Read(buf, 0, to_copy);
                    destination.Write(buf, 0, to_copy);
                    size -= to_copy;
                    to_copy = System.Math.Min(size, BUFFER_SIZE);
                }
            }