diff -r e28265130e4f -r b72c20cd583a jdk/src/share/classes/sun/misc/JavaNioAccess.java --- a/jdk/src/share/classes/sun/misc/JavaNioAccess.java Wed Aug 10 13:44:58 2011 -0700 +++ b/jdk/src/share/classes/sun/misc/JavaNioAccess.java Thu Aug 11 12:40:24 2011 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,9 @@ package sun.misc; +import java.nio.Buffer; +import java.nio.ByteBuffer; + public interface JavaNioAccess { /** * Provides access to information on buffer usage. @@ -36,4 +39,18 @@ long getMemoryUsed(); } BufferPool getDirectBufferPool(); + + /** + * Constructs a direct ByteBuffer referring to the block of memory starting + * at the given memory address and and extending {@code cap} bytes. + * The {@code ob} parameter is an arbitrary object that is attached + * to the resulting buffer. + */ + ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob); + + /** + * Truncates a buffer by changing its capacity to 0. + */ + void truncate(Buffer buf); + }