Package org.apache.tomcat.util.buf
Class AbstractChunk
- java.lang.Object
- 
- org.apache.tomcat.util.buf.AbstractChunk
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Cloneable
 
 public abstract class AbstractChunk extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableBase class for the *Chunk implementation to reduce duplication.- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intARRAY_MAX_SIZEprotected intendprotected booleanhasHashCodeprotected booleanisSetprotected static StringManagersmprotected intstart
 - 
Constructor SummaryConstructors Constructor Description AbstractChunk()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract intgetBufferElement(int index)intgetEnd()intgetLength()intgetLimit()protected intgetLimitInternal()intgetOffset()intgetStart()inthash()inthashCode()intindexOf(java.lang.String src, int srcOff, int srcLen, int myOff)booleanisNull()voidrecycle()Resets the chunk to an uninitialized state.voidsetEnd(int i)voidsetLimit(int limit)Maximum amount of data in this buffer.voidsetOffset(int off)
 
- 
- 
- 
Field Detail- 
smprotected static final StringManager sm 
 - 
ARRAY_MAX_SIZEpublic static final int ARRAY_MAX_SIZE - See Also:
- Constant Field Values
 
 - 
hasHashCodeprotected boolean hasHashCode 
 - 
isSetprotected boolean isSet 
 - 
startprotected int start 
 - 
endprotected int end 
 
- 
 - 
Method Detail- 
setLimitpublic void setLimit(int limit) Maximum amount of data in this buffer. If -1 or not set, the buffer will grow to {ARRAY_MAX_SIZE. Can be smaller than the current buffer size ( which will not shrink ). When the limit is reached, the buffer will be flushed (if out is set) or throw exception.- Parameters:
- limit- The new limit
 
 - 
getLimitpublic int getLimit() 
 - 
getLimitInternalprotected int getLimitInternal() 
 - 
getStartpublic int getStart() - Returns:
- the start position of the data in the buffer
 
 - 
getEndpublic int getEnd() 
 - 
setEndpublic void setEnd(int i) 
 - 
getOffsetpublic int getOffset() 
 - 
setOffsetpublic void setOffset(int off) 
 - 
getLengthpublic int getLength() - Returns:
- the length of the data in the buffer
 
 - 
isNullpublic boolean isNull() 
 - 
indexOfpublic int indexOf(java.lang.String src, int srcOff, int srcLen, int myOff)
 - 
recyclepublic void recycle() Resets the chunk to an uninitialized state.
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
hashpublic int hash() 
 - 
getBufferElementprotected abstract int getBufferElement(int index) 
 
- 
 
-