Package dev.latvian.mods.klib.io
Interface IOUtils
public interface IOUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<StandardOpenOption> static final byte[]static final ReentrantLockstatic final UUIDstatic final Set<StandardOpenOption> static final Set<StandardOpenOption> static final ReentrantLock -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ByteBufferallocateTempBuffer(int maxBufferSize, long fileSize) static ByteBufferallocateTempBuffer(Path file) static voidappendBytes(Path path, ByteBuffer buf, long remainingBytes) static voidclearDirectory(Path dir) static voiddeleteRecursively(Path dir) static StringgetAttribute(Path file, String attribute) static @Nullable ByteBuffergetAttributeBuffer(Path file, String attribute) static @org.jetbrains.annotations.Nullable byte[]getAttributeBytes(Path file, String attribute) static @Nullable InstantgetCreatedTime(Path path) static @Nullable InstantgetLastAccessedTime(Path path) static @Nullable InstantgetLastModifiedTime(Path path) static longstatic FileSystemstatic FileSystempathEndsWith(String suffix) platformCopy(String from, String to) static voidreadFile(Path path, long offset, long size, @Nullable LongConsumer progressConsumer, IOConsumer<ByteBuffer> dataConsumer) static BufferedImageresize(BufferedImage image, int width, int height) static voidrunUnmodified(Path path, PathOperation operation) static booleansetAttribute(Path file, String attribute, String value) static booleansetAttributeBuffer(Path file, String attribute, ByteBuffer value) static booleansetAttributeBytes(Path file, String attribute, byte[] value) static byte[]toByteArray(io.netty.buffer.ByteBuf buf, boolean release) static ByteBuffertoDirect(ByteBuffer buffer) static voidwriteBytes(Path path, ByteBuffer buf, long remainingBytes)
-
Field Details
-
NIL_UUID
-
FS_LOCK
-
ZIP_FS_LOCK
-
READ_OPEN_OPTIONS
-
WRITE_OPEN_OPTIONS
-
APPEND_OPEN_OPTIONS
-
EMPTY_BYTE_ARRAY
static final byte[] EMPTY_BYTE_ARRAY
-
-
Method Details
-
getSize
-
getCreatedTime
-
getLastModifiedTime
-
getLastAccessedTime
-
runUnmodified
- Throws:
IOException
-
deleteRecursively
- Throws:
IOException
-
clearDirectory
- Throws:
IOException
-
toByteArray
static byte[] toByteArray(io.netty.buffer.ByteBuf buf, boolean release) -
writeBytes
- Throws:
IOException
-
appendBytes
- Throws:
IOException
-
allocateTempBuffer
-
allocateTempBuffer
- Throws:
IOException
-
getAttributeBuffer
@Nullable static @Nullable ByteBuffer getAttributeBuffer(Path file, String attribute) throws IOException - Throws:
IOException
-
getAttribute
- Throws:
IOException
-
getAttributeBytes
@Nullable static @org.jetbrains.annotations.Nullable byte[] getAttributeBytes(Path file, String attribute) throws IOException - Throws:
IOException
-
setAttributeBuffer
- Throws:
IOException
-
setAttribute
- Throws:
IOException
-
setAttributeBytes
- Throws:
IOException
-
pathEndsWith
-
openAsZip
- Throws:
IOException
-
openAsZip
- Throws:
IOException
-
platformCopy
-
toDirect
-
resize
-
readFile
static void readFile(Path path, long offset, long size, @Nullable @Nullable LongConsumer progressConsumer, IOConsumer<ByteBuffer> dataConsumer) throws IOException - Throws:
IOException
-