Package dev.latvian.mods.klib.io
Interface IOUtils
public interface IOUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<StandardOpenOption> static final UUIDstatic final Set<StandardOpenOption> -
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 byte[]digest(String algorithm, Path file, long size, @Nullable LongConsumer callback) 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 MessageDigeststatic MessageDigestmd5()static FileSystemstatic FileSystempathEndsWith(String suffix) platformCopy(String from, String to) static byte[]static Instantstatic Stringstatic intreadVarInt(DataInput in) static longreadVarLong(DataInput in) 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(DataOutput out, byte[] bytes) static voidwriteBytes(Path path, ByteBuffer buf, long remainingBytes) static voidwriteExactTime(DataOutput out, Instant value) static voidwriteUTF(DataOutput out, String value) static voidwriteVarInt(DataOutput out, int value) static voidwriteVarLong(DataOutput out, long value)
-
Field Details
-
NIL_UUID
-
WRITE_OPEN_OPTIONS
-
APPEND_OPEN_OPTIONS
-
-
Method Details
-
getSize
-
getCreatedTime
-
getLastModifiedTime
-
getLastAccessedTime
-
runUnmodified
- Throws:
IOException
-
deleteRecursively
- Throws:
IOException
-
clearDirectory
- Throws:
IOException
-
readVarInt
- Throws:
IOException
-
readVarLong
- Throws:
IOException
-
readBytes
- Throws:
IOException
-
readUTF
- Throws:
IOException
-
readExactTime
- Throws:
IOException
-
writeVarInt
- Throws:
IOException
-
writeVarLong
- Throws:
IOException
-
writeBytes
- Throws:
IOException
-
writeUTF
- Throws:
IOException
-
writeExactTime
- Throws:
IOException
-
toByteArray
static byte[] toByteArray(io.netty.buffer.ByteBuf buf, boolean release) -
writeBytes
- Throws:
IOException
-
appendBytes
- Throws:
IOException
-
allocateTempBuffer
-
allocateTempBuffer
- Throws:
IOException
-
md
-
md5
-
digest
static byte[] digest(String algorithm, Path file, long size, @Nullable @Nullable LongConsumer callback) throws IOException - 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
-