code: @Override
      public void write(byte[] b, int off, int len) throws IOException {
          if (currentEntry != null && !currentEntry.isDirectory()) {
              if (currentEntry.getSize() < currentFileSize + len) {
                  throw new IOException( "The current entry[" + currentEntry.getName() + "] size["
                          + currentEntry.getSize() + "] is smaller than the bytes[" + ( currentFileSize + len )
                          + "] being written." );
              }
          }
  
          out.write( b, off, len );
          
          bytesWritten += len;
  
          if (currentEntry != null) {
              currentFileSize += len;
          }        
      }
docs: Checks if the bytes being written exceed the current entry size.
  
  @see java.io.FilterOutputStream#write(byte[], int, int)