Package org.apache.tomcat.util.buf
Class ByteBufferHolder
- java.lang.Object
-
- org.apache.tomcat.util.buf.ByteBufferHolder
-
public class ByteBufferHolder extends java.lang.ObjectSimple wrapper for aByteBufferthat remembers if the buffer has been flipped or not.
-
-
Constructor Summary
Constructors Constructor Description ByteBufferHolder(java.nio.ByteBuffer buf, boolean flipped)Constructs a holder for the specified buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanflip()Flips the buffer if not already flipped.java.nio.ByteBuffergetBuf()Returns the wrapped buffer.booleanisFlipped()Returns whether the buffer has been flipped.
-
-
-
Method Detail
-
getBuf
public java.nio.ByteBuffer getBuf()
Returns the wrapped buffer.- Returns:
- the buffer
-
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
-
-