當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。