43 |
* The CDR input stream that reads data from the byte buffer. |
* The CDR input stream that reads data from the byte buffer. |
44 |
* |
* |
45 |
* @author Audrius Meskauskas (AudriusA@Bioinformatics.org) |
* @author Audrius Meskauskas (AudriusA@Bioinformatics.org) |
|
* |
|
|
* TODO character encoding. Now the encoding can be set, but it is ignored. |
|
|
* If you take this task, scan 'TODO character encoding' for |
|
|
* relevant places. |
|
46 |
*/ |
*/ |
47 |
public class cdrBufInput |
public class cdrBufInput |
48 |
extends cdrInput |
extends cdrInput |
49 |
|
implements gnuValueStream |
50 |
{ |
{ |
51 |
|
/** |
52 |
|
* Use serialVersionUID for interoperability. |
53 |
|
*/ |
54 |
|
private static final long serialVersionUID = 1; |
55 |
|
|
56 |
/** |
/** |
57 |
* The byte array input stream to read data from. |
* The byte array input stream to read data from. |
58 |
*/ |
*/ |
114 |
buffer.reset(); |
buffer.reset(); |
115 |
setInputStream(buffer); |
setInputStream(buffer); |
116 |
} |
} |
117 |
|
|
118 |
|
/** |
119 |
|
* Get the current position in the buffer. |
120 |
|
* |
121 |
|
* @return The position in the buffer, taking offset into consideration. |
122 |
|
*/ |
123 |
|
public int getPosition() |
124 |
|
{ |
125 |
|
return buffer.getPosition(); |
126 |
|
} |
127 |
|
|
128 |
|
/** |
129 |
|
* Jump to the given position, taking offset into consideration. |
130 |
|
*/ |
131 |
|
public void seek(int position) |
132 |
|
{ |
133 |
|
buffer.seek(position); |
134 |
|
setInputStream(buffer); |
135 |
|
} |
136 |
|
|
137 |
|
/** |
138 |
|
* Get the associated RunTime. |
139 |
|
*/ |
140 |
|
public gnuRuntime getRunTime() |
141 |
|
{ |
142 |
|
return runtime; |
143 |
|
} |
144 |
|
|
145 |
|
/** |
146 |
|
* Replace the instance of RunTime. |
147 |
|
*/ |
148 |
|
public void setRunTime(gnuRuntime a_runtime) |
149 |
|
{ |
150 |
|
runtime = a_runtime; |
151 |
|
} |
152 |
|
|
153 |
} |
} |