@throws IOException
338515
private void cacheResource() {

        WsLocationAdmin locSvc = WsLocationAdminImpl.getInstance();
        File tempFile = locSvc.getBundleFile(this, CACHED_RESOURCE_FILE_NAME_PREFIX + url.toString().hashCode());

        WsResource resource = locSvc.asResource(tempFile, true);

        try {
            moveTo(resource);
            this.cachedResource = resource;
            setLastModified(System.currentTimeMillis());
        } catch (IOException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "IOException while attempting to cache resource", e);
        }

    }
1155475
public void startMonitoring()
    throws IOException 
  {
    if (file == null) {
      writer = new PrintWriter(new BufferedOutputStream(System.out));
    } else {
      writer = new PrintWriter(new FileWriter(file, true));
    }
    super.startMonitoring();
  }
561307
@Setup
  public void setup() throws IOException {
    byte[] source = new byte[8192];
    buffer = new Buffer();
    while (buffer.size() < bufferSize) {
      buffer.write(source);
    }
    cursor = new Buffer.UnsafeCursor();
  }
419687
public void loop() throws IOException
	{
		final long start = System.currentTimeMillis();

		final byte[] buf = new byte[maxRcvBuf];
		try {
			if (timeout > 0)
				s.setSoTimeout(timeout);
			while (!quit) {
				if (total > 0) {
					final long now = System.currentTimeMillis();
					int to = (int) (start + total - now);
					if (to <= 0)
						break;
					// query socket timeout directly from socket since subtypes might
					// have modified the timeout during looping
					final int sto = s.getSoTimeout();
					if (sto > 0)
						to = Math.min(to, sto);
					s.setSoTimeout(to);
				}
				try {
					final DatagramPacket p = new DatagramPacket(buf, buf.length);
					s.receive(p);
					final byte[] data = p.getData();
					onReceive((InetSocketAddress) p.getSocketAddress(), data, p.getOffset(), p.getLength());
				}
				catch (final SocketTimeoutException e) {
					if (total == 0 || start + total > System.currentTimeMillis())
						onTimeout();
				}
				catch (final IOException e) {
					if (!reboundSocket)
						throw e;
					reboundSocket = false;
				}
			}
		}
		catch (final InterruptedIOException e) {
			Thread.currentThread().interrupt();
		}
		catch (final IOException e) {
			if (!quit)
				throw e;
		}
		finally {
			quit();
		}
	}
1163337
protected IOException toIoException(Exception e) {
        if (e instanceof IOException) {
            return (IOException) e;
        } else {
            return new IOException("Unexpected failure", e);
        }
    }
835724
private void lock() throws IOException {
		try {
			lock.lockInterruptibly();
		}
		catch (InterruptedException e) {
			Thread.currentThread().interrupt();
			throw new IOException("interrupted");
		}
	}
425879
public void initialize() throws IOException {
    // Create a pipe such that its one end is connected to the input stream used by
    // the uploader and the other end is the write channel used by the caller.
    PipedInputStream pipeSource = new PipedInputStream(pipeBufferSize);
    OutputStream pipeSink = new PipedOutputStream(pipeSource);
    pipeSinkChannel = Channels.newChannel(pipeSink);

    // Connect pipe-source to the stream used by uploader.
    InputStreamContent objectContentStream = new InputStreamContent(contentType, pipeSource);
    // Indicate that we do not know length of file in advance.
    objectContentStream.setLength(-1);
    objectContentStream.setCloseInputStream(false);

    T request = createRequest(objectContentStream);
    request.setDisableGZipContent(true);

    // Change chunk size from default value (10MB) to one that yields higher performance.
    clientRequestHelper.setChunkSize(request, uploadChunkSize);

    // Given that the two ends of the pipe must operate asynchronous relative
    // to each other, we need to start the upload operation on a separate thread.
    uploadOperation = threadPool.submit(new UploadOperation(request, pipeSource));

    isInitialized = true;
  }
268277
public void flush() throws IOException {
    // check if the stream has been closed
    checkError();
    
    // how many bytes were written to the buffer
    long totalBytesWritten = buffer.totalWritten();
    
    // unblock reads from the buffer
    buffer.unblockReads();
    
    // wait until the write thread transfers everything from the
    // buffer to the stream
    while (writeThread.totalBytesTransferred < totalBytesWritten) {
      BufferedByteInputOutput.sleep(1);
    }
    
    InjectionHandler.processEvent(
        InjectionEventCore.BUFFEREDBYTEOUTPUTSTREAM_FLUSH,
        writeThread.totalBytesTransferred);
    
    // check error
    checkError();
    
    // block reads
    buffer.blockReads();
    
    // flush the underlying buffer
    underlyingOutputStream.flush();
  }
301446
public void run() throws IOException, ClassNotFoundException, Util.Exit {
        int i = 0;
        if (outFile != null) {
            /* Everything goes to one big file... */
            ByteArrayOutputStream bout = new ByteArrayOutputStream(8192);
            writeFileTop(bout); /* only once */

            for (TypeElement t: classes) {
                write(bout, t);
            }

            writeIfChanged(bout.toByteArray(), outFile);
        } else {
            /* Each class goes to its own file... */
            for (TypeElement t: classes) {
                ByteArrayOutputStream bout = new ByteArrayOutputStream(8192);
                writeFileTop(bout);
                write(bout, t);
                writeIfChanged(bout.toByteArray(), getFileObject(t.getQualifiedName()));
            }
        }
    }
1264279
public void flush() throws IOException
  {
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
      {
        Tr.debug(tc, "flush");
      }
      this.output.flush();
  }
153725
public void flush() throws IOException {
		if (printWriter != null) {
			printWriter.flush();
		}

		if (gzipOutputStream != null) {
			gzipOutputStream.flush();
		}
	}
476387
public synchronized void flush() throws IOException {
    this.inner.write(this.remainder.getBytes());
    this.inner.flush();
    this.remainder = Bits.NULL;
  }
195340
public void close() throws IOException {
        if (!_closed) {
            try {
                flush();
            } catch (Throwable t) {
                LOG.debug(t.getMessage(), t);
            }
            _closed = true;
            super.close();
        }
    }
322374
public void sendData() throws IOException {
        if (writer != null) {
            writer.write(buffer.toString());
            writer.flush();
            buffer = new StringBuilder();
        }
    }
554903
private void init() throws IOException {
    // move to begin
    IndexInput inField = indexInputList.get("field");
    inField.seek(indexInputOffsetList.get("field"));
    // store field references in memory
    fieldReferences = new HashMap<String, FieldReferences>();
    boolean doInit = true;
    while (doInit) {
      try {
        String field = inField.readString();
        long refIndexDoc = inField.readVLong();
        long refIndexDocId = inField.readVLong();
        int numberOfDocs = inField.readVInt();
        inField.readVLong(); // refTerm
        inField.readVInt(); // numberOfTerms
        long refPrefix = inField.readVLong();
        int numberOfPrefixes = inField.readVInt();
        fieldReferences.put(field, new FieldReferences(refIndexDoc,
            refIndexDocId, numberOfDocs, refPrefix, numberOfPrefixes));
      } catch (IOException e) {
        log.debug(e);
        doInit = false;
      }
    }
    // prefixReferences
    prefixReferences = new HashMap<String, LinkedHashMap<String, Long>>();
  }
282912
private void handleReadBuffer() throws IOException {
        if (readBuffer.remaining() == 0) {
            readBuffer.clear();
            actualFile.read(actualFileOffset, readBuffer);
            actualFileOffset += readBuffer.limit();
            readBuffer.position(0);
        }
    }
792170
void open() throws IOException {
        ListIterator<Appender> ite = appenderList.listIterator();
        while (ite.hasNext()) {
            Appender p = ite.next();
            if (p != null) p.open();
        }
    }