final <U extends AbstractPooledDerivedByteBuf> U init( AbstractByteBuf unwrapped, ByteBuf wrapped, int readerIndex, int writerIndex, int maxCapacity) { wrapped.retain(); // Retain up front to ensure the parent is accessible before doing more work. parent = wrapped; rootParent = unwrapped; try { maxCapacity(maxCapacity); setIndex0(readerIndex, writerIndex); // It is assumed the bounds checking is done by the caller. setRefCnt(1); @SuppressWarnings("unchecked") final U castThis = (U) this; wrapped = null; return castThis; } finally { if (wrapped != null) { parent = rootParent = null; wrapped.release(); } } }
final <U extends AbstractPooledDerivedByteBuf> U init( AbstractByteBuf unwrapped, ByteBuf wrapped, int readerIndex, int writerIndex, int maxCapacity) { wrapped.retain(); // Retain up front to ensure the parent is accessible before doing more work. parent = wrapped; rootParent = unwrapped; try { maxCapacity(maxCapacity); setIndex0(readerIndex, writerIndex); // It is assumed the bounds checking is done by the caller. setRefCnt(1); @SuppressWarnings("unchecked") final U castThis = (U) this; wrapped = null; return castThis; } finally { if (wrapped != null) { parent = rootParent = null; wrapped.release(); } } }
final <U extends AbstractPooledDerivedByteBuf> U init( AbstractByteBuf unwrapped, ByteBuf wrapped, int readerIndex, int writerIndex, int maxCapacity) { wrapped.retain(); // Retain up front to ensure the parent is accessible before doing more work. parent = wrapped; rootParent = unwrapped; try { maxCapacity(maxCapacity); setIndex0(readerIndex, writerIndex); // It is assumed the bounds checking is done by the caller. setRefCnt(1); @SuppressWarnings("unchecked") final U castThis = (U) this; wrapped = null; return castThis; } finally { if (wrapped != null) { parent = rootParent = null; wrapped.release(); } } }
final <U extends AbstractPooledDerivedByteBuf> U init( AbstractByteBuf unwrapped, ByteBuf wrapped, int readerIndex, int writerIndex, int maxCapacity) { wrapped.retain(); // Retain up front to ensure the parent is accessible before doing more work. parent = wrapped; rootParent = unwrapped; try { maxCapacity(maxCapacity); setIndex0(readerIndex, writerIndex); // It is assumed the bounds checking is done by the caller. setRefCnt(1); @SuppressWarnings("unchecked") final U castThis = (U) this; wrapped = null; return castThis; } finally { if (wrapped != null) { parent = rootParent = null; wrapped.release(); } } }
final <U extends AbstractPooledDerivedByteBuf> U init( AbstractByteBuf unwrapped, ByteBuf wrapped, int readerIndex, int writerIndex, int maxCapacity) { wrapped.retain(); // Retain up front to ensure the parent is accessible before doing more work. parent = wrapped; rootParent = unwrapped; try { maxCapacity(maxCapacity); setIndex0(readerIndex, writerIndex); // It is assumed the bounds checking is done by the caller. setRefCnt(1); @SuppressWarnings("unchecked") final U castThis = (U) this; wrapped = null; return castThis; } finally { if (wrapped != null) { parent = rootParent = null; wrapped.release(); } } }
final <U extends AbstractPooledDerivedByteBuf> U init( AbstractByteBuf unwrapped, ByteBuf wrapped, int readerIndex, int writerIndex, int maxCapacity) { wrapped.retain(); // Retain up front to ensure the parent is accessible before doing more work. parent = wrapped; rootParent = unwrapped; try { maxCapacity(maxCapacity); setIndex0(readerIndex, writerIndex); // It is assumed the bounds checking is done by the caller. setRefCnt(1); @SuppressWarnings("unchecked") final U castThis = (U) this; wrapped = null; return castThis; } finally { if (wrapped != null) { parent = rootParent = null; wrapped.release(); } } }
final <U extends AbstractPooledDerivedByteBuf> U init( AbstractByteBuf unwrapped, ByteBuf wrapped, int readerIndex, int writerIndex, int maxCapacity) { wrapped.retain(); // Retain up front to ensure the parent is accessible before doing more work. parent = wrapped; rootParent = unwrapped; try { maxCapacity(maxCapacity); setIndex0(readerIndex, writerIndex); // It is assumed the bounds checking is done by the caller. setRefCnt(1); @SuppressWarnings("unchecked") final U castThis = (U) this; wrapped = null; return castThis; } finally { if (wrapped != null) { parent = rootParent = null; wrapped.release(); } } }