17 |
|
|
18 |
protected class TransientBlockOutputStream extends BlockOutputStream { |
protected class TransientBlockOutputStream extends BlockOutputStream { |
19 |
protected ByteArrayOutputStream baos; |
protected ByteArrayOutputStream baos; |
20 |
|
protected Header822 header; |
21 |
protected Block block; |
protected Block block; |
22 |
|
|
23 |
protected TransientBlockOutputStream() { |
protected TransientBlockOutputStream(Header822 header) { |
24 |
super(new ByteArrayOutputStream()); |
super(new ByteArrayOutputStream()); |
25 |
baos = (ByteArrayOutputStream)out; |
baos = (ByteArrayOutputStream)out; |
26 |
|
this.header = header; |
27 |
} |
} |
28 |
public Block getBlock() { return block; } |
public Block getBlock() { return block; } |
29 |
public Header822 getHeader() { return null; } |
public Header822 getHeader() { return null; } |
30 |
public void close(){ |
public void close() { |
31 |
Header822 h = new SortedHeader822(); |
block = new TransientBlock(baos.toByteArray(), header); |
|
h.add("Content-type", "text/plain"); |
|
|
block = new TransientBlock(baos.toByteArray(),h); |
|
32 |
blocks.put(block.getId(),block); |
blocks.put(block.getId(),block); |
33 |
} |
} |
34 |
} |
} |
37 |
protected byte[] bytes; |
protected byte[] bytes; |
38 |
protected Header822 h; |
protected Header822 h; |
39 |
|
|
40 |
protected TransientBlock(byte[] b, Header822 h){ |
protected TransientBlock(byte[] b, Header822 h) { |
41 |
bytes = b; |
bytes = b; |
42 |
this.h = h; |
this.h = h; |
43 |
} |
} |
58 |
public void delete(Block b) {} |
public void delete(Block b) {} |
59 |
public Set getIds() { return null; } |
public Set getIds() { return null; } |
60 |
public BlockOutputStream getBlockOutputStream(String contentType) { |
public BlockOutputStream getBlockOutputStream(String contentType) { |
61 |
|
Header822 hdr = new UniqueHeader822(); |
62 |
return new TransientBlockOutputStream(); |
hdr.add("Content-Type", contentType); |
63 |
|
return new TransientBlockOutputStream(hdr); |
64 |
|
} |
65 |
|
public BlockOutputStream getBlockOutputStream(Header822 hdr) { |
66 |
|
return null; |
67 |
} |
} |
|
public BlockOutputStream getBlockOutputStream(Header822 hdr) { return null; } |
|
68 |
public String getDefaultPoolName() { return null; } |
public String getDefaultPoolName() { return null; } |
69 |
public Set getPoolNames() { return null; } |
public Set getPoolNames() { return null; } |
70 |
public Pointer getPointer(String uri) { return null; } |
public Pointer getPointer(String uri) { return null; } |