public static void main(String... args) {
        ByteBuffer byteBuffer = ByteBuffer.allocate(10);
        for (int i = 0; i < byteBuffer.capacity(); i++) {
            byteBuffer.put((byte) i);
        }

        ByteBuffer _bytebuffer = byteBuffer.asReadOnlyBuffer();

//        _bytebuffer.put((byte)0);   //java.nio.ReadOnlyBufferException

        byteBuffer.clear();
        byteBuffer.put((byte) 99);

        _bytebuffer.clear();
        System.out.println(_bytebuffer.get());  // share data


    }