Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface ByteBufferFactory{
- static final ByteBufferFactory instance=FactoryImpl.valueOf(System.getProperty("ByteBufferFactory", "DIRECT"));
- ByteBuffer newInstance(int capacity);
- }
- enum FactoryImpl implments ByteBufferFactory{
- DIRECT{
- public ByteBuffer newInstance(capacity){
- .....
- }
- },
- HEAP{
- public X newInstance(capacity){
- .....
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement