APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.tools.jmod

pack-priv Class JmodOutputStream

extends OutputStream
implements AutoCloseable
Class Inheritance
All Implemented Interfaces
java.lang.AutoCloseable
Imports
java.io.BufferedOutputStream, .File, .IOException, .InputStream, .OutputStream, .UncheckedIOException, java.nio.file.Files, .Path, .Paths, java.util.HashMap, .HashSet, .Map, .Set, java.util.zip.ZipEntry, .ZipOutputStream, jdk.internal.jmod.JmodFile, java.time.LocalDateTime

Output stream to write to JMOD file

Field Summary

Modifier and TypeField and Description
private final LocalDateTime
private final Map<JmodFile.Section, Set<String>>
private final ZipOutputStream

Constructor Summary

AccessConstructor and Description
private
JmodOutputStream(OutputStream out, LocalDateTime date, int compressLevel)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.OutputStream.close.

Implements java.lang.AutoCloseable.close, java.io.Closeable.close.

Closes this resource, relinquishing any underlying resources.

public boolean
private ZipEntry
pack-priv static JmodOutputStream
newOutputStream(Path file, LocalDateTime date, int compressLevel)

This method creates (or overrides, if exists) the JMOD file, returning the output stream to write to the JMOD file.

public void
write(int b)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.

public void
writeEntry(InputStream in, JmodFile.Section section, String name)

Writes the input stream to the named entry of the given section.

public void
writeEntry(byte[] bytes, JmodFile.Section section, String path)

Writes the given bytes to the named entry of the given section.

public void
writeEntry(InputStream in, JmodFile.Entry e)

Writes the given entry to the given input stream.

Inherited from java.io.OutputStream:
flushnullOutputStreamwritewrite

Field Detail

dateback to summary
private final LocalDateTime date
entriesback to summary
private final Map<JmodFile.Section, Set<String>> entries
zosback to summary
private final ZipOutputStream zos

Constructor Detail

JmodOutputStreamback to summary
private JmodOutputStream(OutputStream out, LocalDateTime date, int compressLevel)

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.OutputStream.close.

Implements java.lang.AutoCloseable.close, java.io.Closeable.close.

Doc from java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.OutputStream.close.

if an I/O error occurs.

containsback to summary
public boolean contains(JmodFile.Section section, String path)
newEntryback to summary
private ZipEntry newEntry(JmodFile.Section section, String path) throws IOException
newOutputStreamback to summary
pack-priv static JmodOutputStream newOutputStream(Path file, LocalDateTime date, int compressLevel) throws IOException

This method creates (or overrides, if exists) the JMOD file, returning the output stream to write to the JMOD file.

writeback to summary
public void write(int b) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
writeEntryback to summary
public void writeEntry(InputStream in, JmodFile.Section section, String name) throws IOException

Writes the input stream to the named entry of the given section.

writeEntryback to summary
public void writeEntry(byte[] bytes, JmodFile.Section section, String path) throws IOException

Writes the given bytes to the named entry of the given section.

writeEntryback to summary
public void writeEntry(InputStream in, JmodFile.Entry e) throws IOException

Writes the given entry to the given input stream.