congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
BlockBasedFile
Code IndexAdd Tabnine to your IDE (free)

How to use
BlockBasedFile
in
org.eclipse.jgit.internal.storage.dfs

Best Java code snippets using org.eclipse.jgit.internal.storage.dfs.BlockBasedFile (Showing top 6 results out of 315)

origin: org.eclipse.jgit/org.eclipse.jgit

DfsBlock readOneBlock(long pos, DfsReader ctx,
    @Nullable ReadableChannel fileChannel) throws IOException {
  if (invalid)
    throw new PackInvalidException(getFileName());
      : ctx.db.openFile(desc, ext);
  try {
    int size = blockSize(rc);
    pos = (pos / size) * size;
      throw new EOFException(MessageFormat.format(
          DfsText.get().shortReadOfBlock, Long.valueOf(pos),
          getFileName(), Long.valueOf(0), Long.valueOf(0)));
    int cnt = read(rc, ByteBuffer.wrap(buf, 0, size));
    ctx.stats.readBlockBytes += cnt;
    if (cnt != size) {
        throw new EOFException(MessageFormat.format(
            DfsText.get().shortReadOfBlock, Long.valueOf(pos),
            getFileName(), Integer.valueOf(size),
            Integer.valueOf(cnt)));
      rc.close();
    ctx.stats.readBlockMicros += elapsedMicros(start);
origin: org.eclipse.jgit/org.eclipse.jgit

void pin(BlockBasedFile file, long position) throws IOException {
  if (block == null || !block.contains(file.key, position)) {
    // If memory is low, we may need what is in our window field to
    // be cleaned up by the GC during the get for the next window.
    // So we always clear it, even though we are just going to set
    // it again.
    block = null;
    block = file.getOrLoadBlock(position, this);
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

  @Nullable ReadableChannel fileChannel) throws IOException {
final long requestedPosition = position;
position = file.alignToBlock(position);
  boolean credit = true;
  try {
    v = file.readOneBlock(requestedPosition, ctx, fileChannel);
    credit = false;
  } finally {
origin: berlam/github-bucket

  @Nullable ReadableChannel fileChannel) throws IOException {
final long requestedPosition = position;
position = file.alignToBlock(position);
  boolean credit = true;
  try {
    v = file.readOneBlock(requestedPosition, ctx, fileChannel);
    credit = false;
  } finally {
origin: berlam/github-bucket

DfsBlock readOneBlock(long pos, DfsReader ctx,
    @Nullable ReadableChannel fileChannel) throws IOException {
  if (invalid)
    throw new PackInvalidException(getFileName());
      : ctx.db.openFile(desc, ext);
  try {
    int size = blockSize(rc);
    pos = (pos / size) * size;
      throw new EOFException(MessageFormat.format(
          DfsText.get().shortReadOfBlock, Long.valueOf(pos),
          getFileName(), Long.valueOf(0), Long.valueOf(0)));
    int cnt = read(rc, ByteBuffer.wrap(buf, 0, size));
    ctx.stats.readBlockBytes += cnt;
    if (cnt != size) {
        throw new EOFException(MessageFormat.format(
            DfsText.get().shortReadOfBlock, Long.valueOf(pos),
            getFileName(), Integer.valueOf(size),
            Integer.valueOf(cnt)));
      rc.close();
    ctx.stats.readBlockMicros += elapsedMicros(start);
origin: berlam/github-bucket

void pin(BlockBasedFile file, long position) throws IOException {
  if (block == null || !block.contains(file.key, position)) {
    // If memory is low, we may need what is in our window field to
    // be cleaned up by the GC during the get for the next window.
    // So we always clear it, even though we are just going to set
    // it again.
    block = null;
    block = file.getOrLoadBlock(position, this);
  }
}
org.eclipse.jgit.internal.storage.dfsBlockBasedFile

Javadoc

Block based file stored in DfsBlockCache.

Most used methods

  • alignToBlock
  • blockSize
  • elapsedMicros
  • getFileName
  • getOrLoadBlock
  • read
  • readOneBlock

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getResourceAsStream (ClassLoader)
  • setRequestProperty (URLConnection)
  • getSupportFragmentManager (FragmentActivity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Collectors (java.util.stream)
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now