Here you can find the source of checkNotReadOnly(ByteBuffer buffer)
public static void checkNotReadOnly(ByteBuffer buffer)
//package com.java2s; /* Partial import of https://github.com/jpountz/lz4-java, Apache 2.0 licensed. */ import java.nio.ByteBuffer; import java.nio.ReadOnlyBufferException; public class Main { public static void checkNotReadOnly(ByteBuffer buffer) { if (buffer.isReadOnly()) { throw new ReadOnlyBufferException(); }//from w w w. j av a 2s . c o m } }