@Override public synchronized long getMaximumAvailableSpace() { if (_head == null) { // closed return -1L; } // First: how much room do we have in the current write segment? long space = _head.availableForAppend(); // and how many more segments could we allocate? int canAllocate = (_maxSegmentsToAllocate - _usedSegmentsCount); if (canAllocate > 0) { space += (long) canAllocate * (long) _segmentSize; } return space; }
@Override public synchronized long getMaximumAvailableSpace() { if (_head == null) { // closed return -1L; } // First: how much room do we have in the current write segment? long space = _head.availableForAppend(); // and how many more segments could we allocate? int canAllocate = (_maxSegmentsToAllocate - _usedSegmentsCount); if (canAllocate > 0) { space += (long) canAllocate * (long) _segmentSize; } return space; }