本文整理汇总了Java中com.intellij.util.io.IOUtil.readString方法的典型用法代码示例。如果您正苦于以下问题:Java IOUtil.readString方法的具体用法?Java IOUtil.readString怎么用?Java IOUtil.readString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.io.IOUtil
的用法示例。
在下文中一共展示了IOUtil.readString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public void load(DataInputStream in, JpsModel model, final BuildRootIndex buildRootIndex) throws IOException {
final TargetTypeRegistry registry = TargetTypeRegistry.getInstance();
int typeCount = in.readInt();
while (typeCount-- > 0) {
final String typeId = IOUtil.readString(in);
int targetCount = in.readInt();
BuildTargetType<?> type = registry.getTargetType(typeId);
BuildTargetLoader<?> loader = type != null ? type.createLoader(model) : null;
while (targetCount-- > 0) {
final String id = IOUtil.readString(in);
boolean loaded = false;
if (loader != null) {
BuildTarget<?> target = loader.createTarget(id);
if (target != null) {
getDelta(target).load(in, target, buildRootIndex);
myInitialScanPerformed.add(target);
loaded = true;
}
}
if (!loaded) {
LOG.info("Skipping unknown target (typeId=" + typeId + ", type=" + type + ", id=" + id + ")");
FilesDelta.skip(in);
}
}
}
}
示例2: getFrameworkIdOfBuildFile
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
@Nullable
public static String getFrameworkIdOfBuildFile(VirtualFile file) {
if (file instanceof NewVirtualFile) {
final DataInputStream is = FRAMEWORK_FILE_ATTRIBUTE.readAttribute(file);
if (is != null) {
try {
try {
if (is.available() == 0) {
return null;
}
return IOUtil.readString(is);
}
finally {
is.close();
}
}
catch (IOException e) {
LOG.error(file.getPath(), e);
}
}
return "";
}
return file.getUserData(FRAMEWORK_FILE_MARKER);
}
示例3: load
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public void load(DataInput in, @NotNull BuildTarget<?> target, BuildRootIndex buildRootIndex) throws IOException {
lockData();
try {
myDeletedPaths.clear();
int deletedCount = in.readInt();
while (deletedCount-- > 0) {
myDeletedPaths.add(IOUtil.readString(in));
}
myFilesToRecompile.clear();
int recompileCount = in.readInt();
while (recompileCount-- > 0) {
String rootId = IOUtil.readString(in);
BuildRootDescriptor descriptor = target.findRootDescriptor(rootId, buildRootIndex);
Set<File> files;
if (descriptor != null) {
files = myFilesToRecompile.get(descriptor);
if (files == null) {
files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
myFilesToRecompile.put(descriptor, files);
}
}
else {
LOG.debug("Cannot find root by " + rootId + ", delta will be skipped");
files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
}
int filesCount = in.readInt();
while (filesCount-- > 0) {
final File file = new File(IOUtil.readString(in));
if (Utils.IS_TEST_MODE) {
LOG.info("Loaded " + file.getPath());
}
files.add(file);
}
}
}
finally {
unlockData();
}
}
示例4: skip
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public static void skip(DataInput in) throws IOException {
int deletedCount = in.readInt();
while (deletedCount-- > 0) {
IOUtil.readString(in);
}
int recompiledCount = in.readInt();
while (recompiledCount-- > 0) {
IOUtil.readString(in);
int filesCount = in.readInt();
while (filesCount-- > 0) {
IOUtil.readString(in);
}
}
}
示例5: load
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
private boolean load() {
if (!myTargetsFile.exists()) {
return false;
}
try {
DataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(myTargetsFile)));
try {
input.readInt();//reserved for version
int size = input.readInt();
BuildTargetLoader<?> loader = myTargetType.createLoader(myTargetsState.getModel());
while (size-- > 0) {
String stringId = IOUtil.readString(input);
int intId = input.readInt();
myTargetsState.markUsedId(intId);
BuildTarget<?> target = loader.createTarget(stringId);
if (target != null) {
myTargetIds.put(target, intId);
}
else {
LOG.info("Unknown " + myTargetType.getTypeId() + " target: " + stringId);
}
}
return true;
}
finally {
input.close();
}
}
catch (IOException e) {
LOG.info("Cannot load " + myTargetType.getTypeId() + " targets data: " + e.getMessage(), e);
return false;
}
}
示例6: getModificationStamp
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public static long getModificationStamp(VirtualFile file) {
long ret = -1;
Long temporary = file.getUserData(Util.MODIFICATION_DATE_KEY);
if(temporary == null || temporary <= 0) {
if(file instanceof NewVirtualFile) {
final DataInputStream is = MODIFICATION_STAMP_FILE_ATTRIBUTE.readAttribute(file);
if(is != null) {
try {
try {
if(is.available() > 0) {
String value = IOUtil.readString(is);
ret = convertToLong(value, ret);
if(ret > 0) {
file.putUserData(Util.MODIFICATION_DATE_KEY, ret);
}
}
} finally {
is.close();
}
} catch(IOException e) {
// Ignore it but we might need to throw an exception
String message = e.getMessage();
}
}
}
} else {
ret = temporary;
}
return ret;
}
示例7: load
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public void load(DataInput in, @NotNull BuildTarget<?> target, BuildRootIndex buildRootIndex) throws IOException {
myDeletedPaths.clear();
int deletedCount = in.readInt();
while (deletedCount-- > 0) {
myDeletedPaths.add(IOUtil.readString(in));
}
myFilesToRecompile.clear();
int recompileCount = in.readInt();
while (recompileCount-- > 0) {
String rootId = IOUtil.readString(in);
BuildRootDescriptor descriptor = target.findRootDescriptor(rootId, buildRootIndex);
Set<File> files;
if (descriptor != null) {
files = myFilesToRecompile.get(descriptor);
if (files == null) {
files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
myFilesToRecompile.put(descriptor, files);
}
}
else {
LOG.debug("Cannot find root by " + rootId + ", delta will be skipped");
files = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
}
int filesCount = in.readInt();
while (filesCount-- > 0) {
final File file = new File(IOUtil.readString(in));
if (Utils.IS_TEST_MODE) {
LOG.info("Loaded " + file.getPath());
}
files.add(file);
}
}
}
示例8: read
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public Collection<String> read(DataInput in) throws IOException {
final Set<String> result = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
final DataInputStream stream = (DataInputStream)in;
while (stream.available() > 0) {
final String str = IOUtil.readString(stream);
result.add(str);
}
return result;
}
示例9: createValidityState
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public ValidityState createValidityState(DataInput in) throws IOException {
return new DestinationFileInfo(IOUtil.readString(in), true);
}
示例10: GenericCompilerPersistentData
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
public GenericCompilerPersistentData(File cacheStoreDirectory, int compilerVersion) throws IOException {
myCompilerVersion = compilerVersion;
myFile = new File(cacheStoreDirectory, "info");
if (!myFile.exists()) {
LOG.info("Compiler info file doesn't exists: " + myFile.getAbsolutePath());
myVersionChanged = true;
return;
}
try {
DataInputStream input = new DataInputStream(new BufferedInputStream(new FileInputStream(myFile)));
try {
final int dataVersion = input.readInt();
if (dataVersion != VERSION) {
LOG.info("Version of compiler info file (" + myFile.getAbsolutePath() + ") changed: " + dataVersion + " -> " + VERSION);
myVersionChanged = true;
return;
}
final int savedCompilerVersion = input.readInt();
if (savedCompilerVersion != compilerVersion) {
LOG.info("Compiler caches version changed (" + myFile.getAbsolutePath() + "): " + savedCompilerVersion + " -> " + compilerVersion);
myVersionChanged = true;
return;
}
int size = input.readInt();
while (size-- > 0) {
final String target = IOUtil.readString(input);
final int id = input.readInt();
myTarget2Id.put(target, id);
myUsedIds.add(id);
}
}
finally {
input.close();
}
}
catch (IOException e) {
FileUtil.delete(myFile);
throw e;
}
}
示例11: createValidityState
import com.intellij.util.io.IOUtil; //导入方法依赖的package包/类
@Override
public ValidityState createValidityState(DataInput in) throws IOException {
return new DestinationFileInfo(IOUtil.readString(in), true);
}