6341887: Inflater can't handle ByteBuffer - first webrev
Ulf Zibis
Ulf.Zibis at gmx.de
Sat Apr 14 22:21:51 UTC 2012
Am 14.04.2012 23:33, schrieb Ulf Zibis:
> Am 14.04.2012 20:29, schrieb Xueming Shen:
>> (3) The input part will be tough. I was struggling with if we should have a totally separated
>> subclass, like
>> DeflaterBuffer/InfalterBuffer (or BufferDefalter/Inflater) to only handle everything in
>> ByteBuffer with
> Another suggestion: DirectDeflater
Or better: MappedDeflater ("Direct..." is only known from package sun.nio)
>
>> methods handles buffer input and output, throw "not supported operation" for those "byte[]" methods.
> No need for that, if we inherit Deflater + DirectDeflater from AbstractDeflater.
> But personally, I more would like the mandation in the spec. Internally we could set a flag, which
> detects a mixed usage to throw an exception.
Another Suggestion (to additionally avoid the internal instanceof etc.):
public int deflate(MappedByteBuffer bbuffer, int flush) {...}
+
public int deflate(ByteBuffer bbuffer, int flush) {...}
-Ulf
More information about the core-libs-dev
mailing list