ByteFileAttributeAccessor (@NotNull FSRecordsImpl vfs, @NotNull FileAttribute attribute) { return new ByteFileAttributeAccessor() { @Override public byte read(int fileId, byte defaultValue) { Byte value = vfs.readAttributeRaw(fileId, attribute, ByteBuffer::get); return value == null ? defaultValue : value.byteValue(); } @Override public void write(int fileId, byte value) throws IOException { try (var stream = vfs.writeAttribute(fileId, attribute)) { stream.write(value); } //vfs.writeAttributeRaw(fileId, attribute, buffer -> { // return buffer.put(value); //}); } }; }