当前位置: 首页>>代码示例>>Java>>正文


Java ArrayUtil.EMPTY_BYTE_ARRAY属性代码示例

本文整理汇总了Java中com.intellij.util.ArrayUtil.EMPTY_BYTE_ARRAY属性的典型用法代码示例。如果您正苦于以下问题:Java ArrayUtil.EMPTY_BYTE_ARRAY属性的具体用法?Java ArrayUtil.EMPTY_BYTE_ARRAY怎么用?Java ArrayUtil.EMPTY_BYTE_ARRAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.util.ArrayUtil的用法示例。


在下文中一共展示了ArrayUtil.EMPTY_BYTE_ARRAY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getContent

@Override
public byte[] getContent(@NotNull SvnTarget target, @Nullable SVNRevision revision, @Nullable SVNRevision pegRevision)
  throws VcsException, FileTooBigRuntimeException {
  // TODO: rewrite this to provide output as Stream
  // TODO: Also implement max size constraint like in SvnKitContentClient
  // NOTE: Export could not be used to get content of scheduled for deletion file

  List<String> parameters = new ArrayList<String>();
  CommandUtil.put(parameters, target.getPathOrUrlString(), pegRevision);
  CommandUtil.put(parameters, revision);

  CommandExecutor command = null;
  try {
    command = execute(myVcs, target, SvnCommandName.cat, parameters, null);
  }
  catch (SvnBindException e) {
    // "no pristine version" error is thrown, for instance, for locally replaced files (not committed yet)
    if (StringUtil.containsIgnoreCase(e.getMessage(), NO_PRISTINE_VERSION_FOR_FILE)) {
      LOG.debug(e);
    }
    else {
      throw e;
    }
  }

  byte[] bytes = command != null ? command.getBinaryOutput().toByteArray() : ArrayUtil.EMPTY_BYTE_ARRAY;
  ContentRevisionCache.checkContentsSize(target.getPathOrUrlString(), bytes.length);

  return bytes;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:CmdContentClient.java

示例2: getBytes

@NotNull
public byte[] getBytes() throws IOException {
  if (myCachedBytes == null) {
    myCachedBytes = myVirtualFile.isValid() ? myVirtualFile.contentsToByteArray(false) : ArrayUtil.EMPTY_BYTE_ARRAY;
  }

  return myCachedBytes;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:FileContent.java

示例3: contentsToByteArray

@Override
@NotNull
public byte[] contentsToByteArray() throws IOException {
  if (myFileInfo == null) {
    throw new UnsupportedOperationException();
  }

  VirtualFile localFile = myFileInfo.getLocalFile();
  if (localFile != null) {
    return localFile.contentsToByteArray();
  }
  return ArrayUtil.EMPTY_BYTE_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:HttpVirtualFileImpl.java

示例4: gotEntry

public void gotEntry(FileObject abstractFileObject, Entry entry) {
  super.gotEntry(abstractFileObject, entry);
  if (entry == null) {
    myState = DELETED;
    myFileBytes = ArrayUtil.EMPTY_BYTE_ARRAY;
  }
  else {
    myRevision = entry.getRevision();
    myCvsRevisionNumber = new CvsRevisionNumber(myRevision);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GetFileContentOperation.java

示例5: readBytes

private byte[] readBytes(int count) throws IOException {
  if (count > 0) {
    byte[] bytes = new byte[count];
    archive.readFully(bytes);
    return bytes;
  }
  else {
    return ArrayUtil.EMPTY_BYTE_ARRAY;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:JBZipFile.java

示例6: contentsToByteArray

@NotNull
@Override
public byte[] contentsToByteArray(@NotNull String relativePath) throws IOException {
  FileAccessorCache.Handle<ZipFile> zipRef;

  try {
    zipRef = ourZipFileFileAccessorCache.get(this);
  } catch (RuntimeException ex) {
    final Throwable cause = ex.getCause();
    if (cause instanceof IOException) throw (IOException)cause;
    throw ex;
  }
  ZipFile zip = zipRef.get();
  try {
    ZipEntry entry = zip.getEntry(relativePath);
    if (entry != null) {
      InputStream stream = zip.getInputStream(entry);
      if (stream != null) {
        // ZipFile.c#Java_java_util_zip_ZipFile_read reads data in 8K (stack allocated) blocks
        // no sense to create BufferedInputStream
        try {
          return FileUtil.loadBytes(stream, (int)entry.getSize());
        }
        finally {
          stream.close();
        }
      }
    }
  }
  finally {
    zipRef.release();
  }

  return ArrayUtil.EMPTY_BYTE_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:ZipHandler.java

示例7: contentsToByteArray

@NotNull
public byte[] contentsToByteArray() throws IOException {
  if (myContentLoadFailed || myProcessingBeforeContentsChange) {
    return ArrayUtil.EMPTY_BYTE_ARRAY;
  }
  if (myContent == null) {
    loadContent();
  }
  return myContent;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:VcsVirtualFile.java

示例8: loadFileBytes

private synchronized byte[] loadFileBytes() {
  if (myState != LOADING) {
    LOG.error("state = " + String.valueOf(myState));
  }
  if (myReader.isEmpty()) {
    myState = DELETED;
    return ArrayUtil.EMPTY_BYTE_ARRAY;
  }
  else {
    myState = SUCCESSFULLY_LOADED;
    return myReader.getReadContent();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:GetFileContentOperation.java

示例9: loadRevisionCatchingErrors

private static byte[] loadRevisionCatchingErrors(@NotNull GitFileRevision revision) throws VcsException, IOException {
  try {
    return revision.getContent();
  } catch (VcsException e) {
    String m = e.getMessage().trim();
    if (m.startsWith("fatal: ambiguous argument ")
        || (m.startsWith("fatal: Path '") && m.contains("' exists on disk, but not in '"))
        || (m.contains("is in the index, but not at stage "))) {
      return ArrayUtil.EMPTY_BYTE_ARRAY;
    }
    else {
      throw e;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:GitMergeProvider.java

示例10: getContent

@Override
public byte[] getContent() throws IOException {
  return ArrayUtil.EMPTY_BYTE_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:DiffErrorElement.java

示例11: contentsToByteArray

@NotNull
@Override
public byte[] contentsToByteArray() throws IOException {
  return ArrayUtil.EMPTY_BYTE_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:TestDataGroupVirtualFile.java

示例12: BinaryLightVirtualFile

public BinaryLightVirtualFile(@NonNls String name) {
  this(name, ArrayUtil.EMPTY_BYTE_ARRAY);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:BinaryLightVirtualFile.java

示例13: setEmptyContent

public void setEmptyContent() {
  myCachedBytes = ArrayUtil.EMPTY_BYTE_ARRAY;
  myCachedLength = 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:FileContent.java

示例14: contentsToByteArray

@Override
@NotNull
public byte[] contentsToByteArray() throws IOException {
  return ArrayUtil.EMPTY_BYTE_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:Mock.java

示例15: contentsToByteArray

@Override
@NotNull
public byte[] contentsToByteArray(@NotNull final VirtualFile file) throws IOException {
  return ArrayUtil.EMPTY_BYTE_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:MockLocalFileSystem.java


注:本文中的com.intellij.util.ArrayUtil.EMPTY_BYTE_ARRAY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。