KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > jayasoft > ivy > util > CopyProgressEvent


1 /*
2  * This file is subject to the license found in LICENCE.TXT in the root directory of the project.
3  *
4  * #SNAPSHOT#
5  */

6 package fr.jayasoft.ivy.util;
7
8 /**
9  * Event reporting a stream copy progression
10  */

11 public class CopyProgressEvent {
12     private long _totalReadBytes;
13     private byte[] _buffer;
14     private int _readBytes;
15     
16     public CopyProgressEvent() {
17     }
18     public CopyProgressEvent(byte[] buffer, int read, long total) {
19         update(buffer, read, total);
20     }
21     public CopyProgressEvent(byte[] buffer, long total) {
22         update(buffer, 0, total);
23     }
24     protected CopyProgressEvent update(byte[] buffer, int read, long total) {
25         _buffer = buffer;
26         _readBytes = read;
27         _totalReadBytes = total;
28         return this;
29     }
30     public long getTotalReadBytes() {
31         return _totalReadBytes;
32     }
33     public byte[] getBuffer() {
34         return _buffer;
35     }
36     
37     public int getReadBytes() {
38         return _readBytes;
39     }
40     
41 }
42
Popular Tags