Class IOHelper
java.lang.Object
cool.scx.io.IOHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]compressBytes(byte[] bytes, int offset, int length) static longgetFileSize(Path path) static LinkedDataReaderinputStreamToDataReader(InputStream inputStream) 此方法会尽量脱壳 防止过多的包装层static voidreadInToFile(InputStream in, Path path, long offset, long length) static voidreadInToFile(InputStream in, Path path, OpenOption... options) static inttransferByteBuffer(ByteBuffer source, ByteBuffer dest) static voidwriteFileToOut(Path path, OutputStream out) static voidwriteFileToOut(Path path, OutputStream out, long offset, long length)
-
Constructor Details
-
IOHelper
public IOHelper()
-
-
Method Details
-
inputStreamToDataReader
此方法会尽量脱壳 防止过多的包装层 -
getFileSize
-
compressBytes
public static byte[] compressBytes(byte[] bytes, int offset, int length) -
writeFileToOut
- Throws:
IOException
-
writeFileToOut
public static void writeFileToOut(Path path, OutputStream out, long offset, long length) throws IOException - Throws:
IOException
-
readInToFile
public static void readInToFile(InputStream in, Path path, OpenOption... options) throws IOException - Throws:
IOException
-
readInToFile
public static void readInToFile(InputStream in, Path path, long offset, long length) throws IOException - Throws:
IOException
-
transferByteBuffer
-