Package jetbrains.buildServer.util
Class TCStreamUtil
- java.lang.Object
-
- jetbrains.buildServer.util.TCStreamUtil
-
public class TCStreamUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTCStreamUtil.ProgressIncrementListenerstatic interfaceTCStreamUtil.WriteProgressListener
-
Constructor Summary
Constructors Constructor Description TCStreamUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanhaveEqualContent(InputStream stream1, InputStream stream2)static booleanhaveEqualContentIgnoringLineEndings(Reader reader1, Reader reader2)static StringreadString(DataInputStream input)static booleansetFileMode(File file, String mode)static voidskip(InputStream input, long size)static voidwriteBinary(InputStream input, long length, OutputStream output)static voidwriteBinary(InputStream input, OutputStream output)Copies input stream into output stream using internal bufferstatic voidwriteBinary(InputStream input, OutputStream output, TCStreamUtil.WriteProgressListener listener, long minProgressIntervalMillis)Copies input stream into output stream using internal bufferstatic voidwriteString(DataOutputStream outputStream, String string)
-
-
-
Method Detail
-
skip
public static void skip(@NotNull InputStream input, long size) throws IOException- Throws:
IOException
-
writeBinary
public static void writeBinary(@NotNull InputStream input, long length, @NotNull OutputStream output) throws IOException- Throws:
IOException
-
writeBinary
public static void writeBinary(InputStream input, OutputStream output) throws IOException
Copies input stream into output stream using internal buffer- Throws:
IOException
-
writeBinary
public static void writeBinary(@NotNull InputStream input, @NotNull OutputStream output, @Nullable TCStreamUtil.WriteProgressListener listener, long minProgressIntervalMillis) throws IOExceptionCopies input stream into output stream using internal buffer- Parameters:
input- input stream to be processedoutput- stream where input stream will be copiedlistener- progress listener which can also cancel the processminProgressIntervalMillis- number of milliseconds between calls to the listener- Throws:
IOException- if IOException occurs
-
setFileMode
public static boolean setFileMode(@Nullable File file, @NotNull String mode) throws IOException- Parameters:
file- filemode- mode to be sent to 'chmod' command- Returns:
- true if windows os is used or if operation has succeeded, false is returned otherwise
- Throws:
IOException- if process run crashed unexpectedly
-
readString
@Nullable public static String readString(@NotNull DataInputStream input) throws IOException
- Throws:
IOException
-
writeString
public static void writeString(@NotNull DataOutputStream outputStream, @NotNull String string) throws IOException- Throws:
IOException
-
haveEqualContent
public static boolean haveEqualContent(@NotNull InputStream stream1, @NotNull InputStream stream2)
-
haveEqualContentIgnoringLineEndings
public static boolean haveEqualContentIgnoringLineEndings(Reader reader1, Reader reader2) throws IOException
- Throws:
IOException
-
-