41 |
*/ |
*/ |
42 |
protected Map dbs; |
protected Map dbs; |
43 |
|
|
44 |
protected class TransientBlockOutputStream extends AbstractBlockOutputStream |
protected class TransientBlockOutputStream extends AbstractBlockOutputStream { |
|
|
|
|
{ |
|
|
protected ByteArrayOutputStream baos; |
|
|
|
|
45 |
protected TransientBlockOutputStream(Header822 header) |
protected TransientBlockOutputStream(Header822 header) |
46 |
throws IOException { |
throws IOException { |
47 |
super(new ByteArrayOutputStream(), header); |
super(new ByteArrayOutputStream(), header); |
|
baos = (ByteArrayOutputStream)out; |
|
48 |
} |
} |
49 |
|
|
50 |
public void close() throws IOException { |
public void close() throws IOException { |
51 |
|
ByteArrayOutputStream baos = (ByteArrayOutputStream)out; |
52 |
block = new TransientBlock(makeIdFromDigest(), |
block = new TransientBlock(makeIdFromDigest(), |
53 |
baos.toByteArray(), header); |
baos.toByteArray(), header); |
54 |
blocks.put(block.getId(), block); |
blocks.put(block.getId(), block); |
65 |
Header822 header) throws IOException { |
Header822 header) throws IOException { |
66 |
super(id, header); |
super(id, header); |
67 |
this.bytes = bytes; |
this.bytes = bytes; |
68 |
|
|
69 |
|
id.check(bytes); |
70 |
} |
} |
71 |
|
|
72 |
public InputStream getRawInputStream() throws IOException { |
public InputStream getRawInputStream() throws IOException { |