harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sian January" <sianjanu...@googlemail.com>
Subject Re: [classlib][pack200] Decoupling I/O and processing for unpacking scenario
Date Fri, 18 Jul 2008 13:29:07 GMT
On 18/07/2008, Aleksey Shipilev <aleksey.shipilev@gmail.com> wrote:
>
> Sian,
>
> On Fri, Jul 18, 2008 at 5:16 PM, Sian January
> <sianjanuary@googlemail.com> 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message