Mercurial > jhg
comparison src/org/tmatesoft/hg/util/ByteChannel.java @ 148:1a7a9a20e1f9
Exceptions, javadoc. Initial cancel and progress support
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 23 Feb 2011 22:36:28 +0100 |
parents | 7567f4a42fe5 |
children |
comparison
equal
deleted
inserted
replaced
147:a05145db4d0c | 148:1a7a9a20e1f9 |
---|---|
14 * the terms of a license other than GNU General Public License | 14 * the terms of a license other than GNU General Public License |
15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com |
16 */ | 16 */ |
17 package org.tmatesoft.hg.util; | 17 package org.tmatesoft.hg.util; |
18 | 18 |
19 import java.io.IOException; | |
19 import java.nio.ByteBuffer; | 20 import java.nio.ByteBuffer; |
20 | 21 |
21 /** | 22 /** |
22 * Much like {@link java.nio.channels.WritableByteChannel} except for thrown exception | 23 * Much like {@link java.nio.channels.WritableByteChannel} except for thrown exception |
23 * | 24 * |
28 */ | 29 */ |
29 public interface ByteChannel { | 30 public interface ByteChannel { |
30 // XXX does int return value makes any sense given buffer keeps its read state | 31 // XXX does int return value makes any sense given buffer keeps its read state |
31 // not clear what retvalue should be in case some filtering happened inside write - i.e. return | 32 // not clear what retvalue should be in case some filtering happened inside write - i.e. return |
32 // number of bytes consumed in | 33 // number of bytes consumed in |
33 int write(ByteBuffer buffer) throws Exception /*FIXME Exception type*/; | 34 int write(ByteBuffer buffer) throws IOException, CancelledException; |
34 } | 35 } |