public static ByteBuf wrappedBuffer ( ByteBuf buffer ) { if ( buffer . isReadable ( ) ) { return buffer . slice ( ) ; } else { buffer . release ( ) ; return EMPTY_BUFFER ; } }
Creates a new buffer which wraps the specified buffer s readable bytes . A modification on the specified buffer s content will be visible to the returned buffer .