Debian Codegraph @

src/main/java/org/freehep/util/io/IncompleteActionException.java

raw
1 // Copyright 2001, FreeHEP.
2 package org.freehep.util.io;
3
4 import java.io.IOException;
5
6 /**
7 * Exception for the TaggedInputStream. Signals that the inputstream contains
8 * more bytes than the stream has read for this action.
9 *
10 * @author Mark Donszelmann
11 * @author Charles Loomis
12 * @version $Id: IncompleteActionException.java 8584 2006-08-10 23:06:37Z duns $
13 */
14 public class IncompleteActionException extends IOException {
15
16 /**
17 *
18 */
19 private static final long serialVersionUID = -6817511986951461967L;
20
21 private Action action;
22
23 private byte[] rest;
24
25 /**
26 * Creates an Incomplete Action Exception
27 *
28 * @param action incompleted action
29 * @param rest unused bytes
30 */
31 public IncompleteActionException(Action action, byte[] rest) {
32 super("Action " + action + " contains " + rest.length + " unread bytes");
33 this.action = action;
34 this.rest = rest;
35 }
36
37 /**
38 * @return action
39 */
40 public Action getAction() {
41 return action;
42 }
43
44 /**
45 * @return unused bytes
46 */
47 public byte[] getBytes() {
48 return rest;
49 }
50 }