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
- Author:
- Phillip Webb
-
Method Summary
Modifier and TypeMethodDescriptionstatic Layer
fromTarArchive
(TarArchive tarArchive) Factory method to create a newLayer
from aTarArchive
.getId()
Return the ID of the layer.static Layer
of
(IOConsumer<Layout> layout) int
size()
The size of the content in bytes.void
writeTo
(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:Content
The size of the content in bytes. -
writeTo
Description copied from interface:Content
Write the content to the given output stream.- Specified by:
writeTo
in 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 newLayer
from aTarArchive
.- Parameters:
tarArchive
- the contents of the layer- Returns:
- a new layer instance
- Throws:
IOException
- on error
-