Example usage for io.netty.buffer ByteBufInputStream ByteBufInputStream

List of usage examples for io.netty.buffer ByteBufInputStream ByteBufInputStream

Introduction

In this page you can find the example usage for io.netty.buffer ByteBufInputStream ByteBufInputStream.

Prototype

public ByteBufInputStream(ByteBuf buffer, int length, boolean releaseOnClose) 

Source Link

Document

Creates a new stream which reads data from the specified buffer starting at the current readerIndex and ending at readerIndex + length .

Usage

From source file:blazingcache.client.CacheEntry.java

License:Apache License

/**
 * Access to data. You have to close the stream in order to handle correctly
 * refcounts/* w ww  .j a  va 2  s.c o  m*/
 *
 * @return
 */
public InputStream getSerializedDataStream() {
    return new ByteBufInputStream(buf.retainedSlice(), buf.readableBytes(), true /* releaseOnClose */);
}