# Interface BuildCacheEntryWriter

public interface BuildCacheEntryWriter
Writer to serialize a build cache entry.

Since:
  3.3

- ## Method Summary

  Modifier and Type
  Method
  Description
  `InputStream`
  `getInputStream()`
  Gets an input stream providing the build cache entry content.
  `long`
  `getSize()`
  Returns the size of the build cache entry to be written.
  `void`
  `writeTo(OutputStream output)`
  Writes a build cache entry to the given stream.

- ## Method Details

  - ### writeTo

    void writeTo(OutputStream output) throws IOException
    Writes a build cache entry to the given stream.

    The given output stream will be closed by this method.

    Parameters:
      `output` - output stream to write build cache entry to
    Throws:
      `IOException` - when an I/O error occurs when writing the cache entry to the given output stream

  - ### getInputStream

    @Incubating InputStream getInputStream() throws IOException
    Gets an input stream providing the build cache entry content.

    This method returns a new InputStream on each invocation. The caller is responsible for closing the stream.

    Throws:
      `IOException`
    Since:
      9.7.0

  - ### getSize

    long getSize()
    Returns the size of the build cache entry to be written.
    Returns:
      the size of the build cache entry to be written.
    Since:
      4.1