Package org.jboss.as.process.protocol
Class StreamUtils
- java.lang.Object
-
- org.jboss.as.process.protocol.StreamUtils
-
public final class StreamUtils extends Object
- Author:
- David M. Lloyd
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopyStream(InputStream in, OutputStream out)static booleanreadBoolean(InputStream input)static bytereadByte(InputStream stream)static voidreadFully(InputStream in, byte[] b)static voidreadFully(InputStream in, byte[] b, int off, int len)static intreadInt(InputStream in)static longreadLong(InputStream in)static intreadUnsignedByte(InputStream stream)static intreadUnsignedShort(InputStream input)static StringreadUTFZBytes(InputStream input)static voidsafeClose(Closeable closeable)static voidsafeClose(ServerSocket serverSocket)static voidsafeClose(Socket socket)static voidsafeClose(XMLStreamWriter writer)static voidwriteBoolean(OutputStream os, boolean b)static voidwriteChar(OutputStream output, char c)static voidwriteInt(OutputStream out, int v)static voidwriteLong(OutputStream out, long v)static voidwriteShort(OutputStream out, int value)static voidwriteString(OutputStream output, Object o)static voidwriteString(OutputStream output, String s)static voidwriteUTFZBytes(OutputStream outputStream, String string)
-
-
-
Method Detail
-
readBoolean
public static boolean readBoolean(InputStream input) throws IOException
- Throws:
IOException
-
readUnsignedShort
public static int readUnsignedShort(InputStream input) throws IOException
- Throws:
IOException
-
readInt
public static int readInt(InputStream in) throws IOException
- Throws:
IOException
-
readFully
public static void readFully(InputStream in, byte[] b) throws IOException
- Throws:
IOException
-
readFully
public static void readFully(InputStream in, byte[] b, int off, int len) throws IOException
- Throws:
IOException
-
readLong
public static long readLong(InputStream in) throws IOException
- Throws:
IOException
-
writeString
public static void writeString(OutputStream output, Object o) throws IOException
- Throws:
IOException
-
writeString
public static void writeString(OutputStream output, String s) throws IOException
- Throws:
IOException
-
writeChar
public static void writeChar(OutputStream output, char c) throws IOException
- Throws:
IOException
-
writeShort
public static void writeShort(OutputStream out, int value) throws IOException
- Throws:
IOException
-
writeInt
public static void writeInt(OutputStream out, int v) throws IOException
- Throws:
IOException
-
writeLong
public static void writeLong(OutputStream out, long v) throws IOException
- Throws:
IOException
-
writeBoolean
public static void writeBoolean(OutputStream os, boolean b) throws IOException
- Throws:
IOException
-
readByte
public static byte readByte(InputStream stream) throws IOException
- Throws:
IOException
-
readUnsignedByte
public static int readUnsignedByte(InputStream stream) throws IOException
- Throws:
IOException
-
copyStream
public static void copyStream(InputStream in, OutputStream out) throws IOException
- Throws:
IOException
-
readUTFZBytes
public static String readUTFZBytes(InputStream input) throws IOException
- Throws:
IOException
-
writeUTFZBytes
public static void writeUTFZBytes(OutputStream outputStream, String string) throws IOException
- Throws:
IOException
-
safeClose
public static void safeClose(Closeable closeable)
-
safeClose
public static void safeClose(Socket socket)
-
safeClose
public static void safeClose(ServerSocket serverSocket)
-
safeClose
public static void safeClose(XMLStreamWriter writer)
-
-