Class StreamUtils
- java.lang.Object
-
- com.github.toolarium.sanitize.content.impl.bleach.util.StreamUtils
-
public final class StreamUtils extends java.lang.ObjectStream utility class
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopy(java.io.InputStream is, java.io.OutputStream os)Copy streamstatic StreamUtilsgetInstance()Get the instancebooleanhasHeader(java.lang.String name, java.io.InputStream stream, byte[] header)Check content headerjava.io.Filesave(java.io.InputStream is, java.io.File file)Store a stream into a file
-
-
-
Method Detail
-
getInstance
public static StreamUtils getInstance()
Get the instance- Returns:
- the instance
-
hasHeader
public boolean hasHeader(java.lang.String name, java.io.InputStream stream, byte[] header)Check content header- Parameters:
name- the namestream- the streamheader- the header to check- Returns:
- true if it has the header
-
copy
public void copy(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOExceptionCopy stream- Parameters:
is- the input streamos- the output stream- Throws:
java.io.IOException- In case of an I/O error
-
save
public java.io.File save(java.io.InputStream is, java.io.File file) throws java.io.IOExceptionStore a stream into a file- Parameters:
is- the input streamfile- the file- Returns:
- the file
- Throws:
java.io.IOException- In case of an I/O error
-
-