Code example for ByteBuffer

Methods: array

0
	public CacheResponseData( 
			BufferCacheServletResponse bufferCacheServletResponse)
		throws IOException { 
 
		_byteBuffer = bufferCacheServletResponse.getByteBuffer();
		_content = _byteBuffer.array();
		_contentType = bufferCacheServletResponse.getContentType();
		_headers = bufferCacheServletResponse.getHeaders();
	} 
 
	public Object getAttribute(String name) {
		return _attributes.get(name);
	} 
 
	public ByteBuffer getByteBuffer() {
		if (_byteBuffer == null) {
			_byteBuffer = ByteBuffer.wrap(_content);
		} 
 
		return _byteBuffer;
	}