Class ByteBufferHolder
java.lang.Object
org.apache.tomcat.util.buf.ByteBufferHolder
Simple wrapper for a
ByteBuffer that remembers if the buffer has been flipped or not.-
Constructor Summary
ConstructorsConstructorDescriptionByteBufferHolder(ByteBuffer buf, boolean flipped) Constructs a holder for the specified buffer. -
Method Summary
-
Constructor Details
-
ByteBufferHolder
Constructs a holder for the specified buffer.- Parameters:
buf- the bufferflipped- initial flipped state
-
-
Method Details
-
getBuf
-
isFlipped
public boolean isFlipped()Returns whether the buffer has been flipped.- Returns:
- true if flipped
-
flip
public boolean flip()Flips the buffer if not already flipped.- Returns:
- true if the buffer was flipped by this call
-