16 |
this.format = format; |
this.format = format; |
17 |
} |
} |
18 |
|
|
19 |
|
/** Check whether this block matches the given id. |
20 |
|
*/ |
21 |
|
public void checkId(BlockId id) throws IOException, BlockId.WrongIdException { |
22 |
|
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
23 |
|
writeTo(out); |
24 |
|
id.check(out.toByteArray()); |
25 |
|
} |
26 |
|
|
27 |
/** Write the whole block (header and body) to an output stream. |
/** Write the whole block (header and body) to an output stream. |
28 |
*/ |
*/ |
29 |
//public abstract void writeTo(OutputStream out); |
public abstract void writeTo(OutputStream out) throws IOException; |
30 |
} |
} |