public DataBuffer compress ( DataBuffer buffer , String algorithm ) { algorithm = algorithm . toUpperCase ( ) ; if ( ! codecs . containsKey ( algorithm ) ) throw new RuntimeException ( "Non-existent compression algorithm requested: [" + algorithm + "]" ) ; return codecs . get ( algorithm ) . compress ( buffer ) ; }
Compress the data buffer given a specified algorithm