On 18/07/2008, Aleksey Shipilev <[EMAIL PROTECTED]> wrote: > > Sian, > > On Fri, Jul 18, 2008 at 5:16 PM, Sian January > <[EMAIL PROTECTED]> wrote: > > There is an optional field in the segment header - archive_size that can > > give the size in bytes or be 0 if the compressor chooses not to specify > the > > size. I've just checked and Sun's compressor does specify this, and we > can > > do in ours when it's written, although we will also have to allow for the > > possibility that it will be 0. > Awesome! Am I understanding correctly: this value determines the size > of segment? If yes, can you point me how to access this value? Is > there API in current implementation?
Yes - use SegmentHeader.getArchiveSize() I think we can just check this field in Archive and: > a. if the field != 0, then synchronously copy out entire segment from > inputStream to Segment's internal and do the unsynchronized > Segment.read() against internal buffer. > b. if the field == 0, then synchronously do the Segment.read() agains > the inputStream Sounds like a good plan. Thanks, > Aleksey. > -- Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
