congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DataUtils.writeFully
Code IndexAdd Tabnine to your IDE (free)

How to use
writeFully
method
in
org.h2.mvstore.DataUtils

Best Java code snippets using org.h2.mvstore.DataUtils.writeFully (Showing top 8 results out of 315)

origin: com.h2database/h2

/**
 * Write to the file.
 *
 * @param pos the write position
 * @param src the source buffer
 */
public void writeFully(long pos, ByteBuffer src) {
  int len = src.remaining();
  fileSize = Math.max(fileSize, pos + len);
  DataUtils.writeFully(file, pos, src);
  writeCount.incrementAndGet();
  writeBytes.addAndGet(len);
}
origin: org.wowtools/h2

/**
 * Write to the file.
 *
 * @param pos the write position
 * @param src the source buffer
 */
public void writeFully(long pos, ByteBuffer src) {
  int len = src.remaining();
  fileSize = Math.max(fileSize, pos + len);
  DataUtils.writeFully(file, pos, src);
  writeCount++;
  writeBytes += len;
}
origin: com.eventsourcing/h2

/**
 * Write to the file.
 *
 * @param pos the write position
 * @param src the source buffer
 */
public void writeFully(long pos, ByteBuffer src) {
  int len = src.remaining();
  fileSize = Math.max(fileSize, pos + len);
  DataUtils.writeFully(file, pos, src);
  writeCount++;
  writeBytes += len;
}
origin: com.h2database/h2-mvstore

/**
 * Write to the file.
 *
 * @param pos the write position
 * @param src the source buffer
 */
public void writeFully(long pos, ByteBuffer src) {
  int len = src.remaining();
  fileSize = Math.max(fileSize, pos + len);
  DataUtils.writeFully(file, pos, src);
  writeCount.incrementAndGet();
  writeBytes.addAndGet(len);
}
origin: org.wowtools/h2

if (plus > 0) {
  temp = ByteBuffer.allocate(plus);
  DataUtils.writeFully(base, p + HEADER_LENGTH + l, temp);
origin: com.eventsourcing/h2

if (plus > 0) {
  temp = ByteBuffer.allocate(plus);
  DataUtils.writeFully(base, p + HEADER_LENGTH + l, temp);
origin: org.wowtools/h2

private void init() throws IOException {
  if (xts != null) {
    return;
  }
  this.size = base.size() - HEADER_LENGTH;
  boolean newFile = size < 0;
  byte[] salt;
  if (newFile) {
    byte[] header = Arrays.copyOf(HEADER, BLOCK_SIZE);
    salt = MathUtils.secureRandomBytes(SALT_LENGTH);
    System.arraycopy(salt, 0, header, SALT_POS, salt.length);
    DataUtils.writeFully(base, 0, ByteBuffer.wrap(header));
    size = 0;
  } else {
    salt = new byte[SALT_LENGTH];
    DataUtils.readFully(base, SALT_POS, ByteBuffer.wrap(salt));
    if ((size & BLOCK_SIZE_MASK) != 0) {
      size -= BLOCK_SIZE;
    }
  }
  AES cipher = new AES();
  cipher.setKey(SHA256.getPBKDF2(
      encryptionKey, salt, HASH_ITERATIONS, 16));
  encryptionKey = null;
  xts = new XTS(cipher);
}
origin: com.eventsourcing/h2

private void init() throws IOException {
  if (xts != null) {
    return;
  }
  this.size = base.size() - HEADER_LENGTH;
  boolean newFile = size < 0;
  byte[] salt;
  if (newFile) {
    byte[] header = Arrays.copyOf(HEADER, BLOCK_SIZE);
    salt = MathUtils.secureRandomBytes(SALT_LENGTH);
    System.arraycopy(salt, 0, header, SALT_POS, salt.length);
    DataUtils.writeFully(base, 0, ByteBuffer.wrap(header));
    size = 0;
  } else {
    salt = new byte[SALT_LENGTH];
    DataUtils.readFully(base, SALT_POS, ByteBuffer.wrap(salt));
    if ((size & BLOCK_SIZE_MASK) != 0) {
      size -= BLOCK_SIZE;
    }
  }
  AES cipher = new AES();
  cipher.setKey(SHA256.getPBKDF2(
      encryptionKey, salt, HASH_ITERATIONS, 16));
  encryptionKey = null;
  xts = new XTS(cipher);
}
org.h2.mvstoreDataUtilswriteFully

Javadoc

Write to a file channel.

Popular methods of DataUtils

  • readVarInt
    Read a variable size int.
  • appendMap
    Append a map to the string builder, sorted by key.
  • checkArgument
    Throw an IllegalArgumentException if the argument is invalid.
  • copyExcept
    Copy the elements of an array, and remove one element.
  • copyWithGap
    Copy the elements of an array, with a gap.
  • encodeLength
    Convert the length to a length code 0..31. 31 means more than 1 MB.
  • formatMessage
    Format an error message.
  • getCheckValue
    Calculate a check value for the given integer. A check value is mean to verify the data is consisten
  • getErrorCode
    Get the error code from an exception message.
  • getFletcher32
    Calculate the Fletcher32 checksum.
  • getPageChunkId
    Get the chunk id from the position.
  • getPageMaxLength
    Get the maximum length for the given code. For the code 31, PAGE_LARGE is returned.
  • getPageChunkId,
  • getPageMaxLength,
  • getPageOffset,
  • getPagePos,
  • getPageType,
  • getVarIntLen,
  • initCause,
  • newIllegalArgumentException,
  • newIllegalStateException,
  • newUnsupportedOperationException

Popular in Java

  • Reading from database using SQL prepared statement
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JCheckBox (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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