Class Layer
java.lang.Object
org.springframework.boot.buildpack.platform.docker.type.Layer
- All Implemented Interfaces:
Content
A layer that can be written to an
ImageArchive.- Since:
- 2.3.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic LayerfromTarArchive(TarArchive tarArchive) Factory method to create a newLayerfrom aTarArchive.getId()Return the ID of the layer.static Layerof(IOConsumer<Layout> layout) intsize()The size of the content in bytes.voidwriteTo(OutputStream outputStream) Write the content to the given output stream.
-
Method Details
-
getId
Return the ID of the layer.- Returns:
- the layer ID
-
size
public int size()Description copied from interface:ContentThe size of the content in bytes. -
writeTo
Description copied from interface:ContentWrite the content to the given output stream.- Specified by:
writeToin interfaceContent- Parameters:
outputStream- the output stream to write to- Throws:
IOException- on IO error
-
of
- Parameters:
layout- the layer layout- Returns:
- a new layer instance
- Throws:
IOException- on IO error
-
fromTarArchive
Factory method to create a newLayerfrom aTarArchive.- Parameters:
tarArchive- the contents of the layer- Returns:
- a new layer instance
- Throws:
IOException- on error
-