spaceLeft = spaceLeft(); if (!blockingWrite && spaceLeft < 1) throw new BufferOverflowException("CircularByteBuffer is full; cannot write 1 byte"); if (spaceLeft > 0){ buffer[writePosition] = (byte)(c & 0xff);
spaceLeft = spaceLeft(); if (!blockingWrite && spaceLeft < len) throw new BufferOverflowException("CircularByteBuffer is full; cannot write " + len + " bytes"); int realLen = Math.min(len, spaceLeft); int firstLen = Math.min(realLen, buffer.length - writePosition);