Search in sources :

Example 26 with ByteArrayDataOutput

use of com.google.common.io.ByteArrayDataOutput in project presto by prestodb.

the class RaptorColumnIdentity method serialize.

@Override
public byte[] serialize() {
    ByteArrayDataOutput output = newDataOutput(SERIALIZED_SIZE);
    output.write(CURRENT_VERSION);
    output.writeLong(columnId);
    return output.toByteArray();
}
Also used : ByteArrayDataOutput(com.google.common.io.ByteArrayDataOutput)

Example 27 with ByteArrayDataOutput

use of com.google.common.io.ByteArrayDataOutput in project EventHub by Codecademy.

the class JournalUtil method locationToBytes.

public static byte[] locationToBytes(Location location) throws IOException {
    ByteArrayDataOutput dos = ByteStreams.newDataOutput();
    location.writeExternal(dos);
    return dos.toByteArray();
}
Also used : ByteArrayDataOutput(com.google.common.io.ByteArrayDataOutput)

Example 28 with ByteArrayDataOutput

use of com.google.common.io.ByteArrayDataOutput in project drill by apache.

the class HiveScan method serializeInputSplit.

public static String serializeInputSplit(final InputSplit split) throws IOException {
    final ByteArrayDataOutput byteArrayOutputStream = ByteStreams.newDataOutput();
    split.write(byteArrayOutputStream);
    final String encoded = Base64.encodeBase64String(byteArrayOutputStream.toByteArray());
    logger.debug("Encoded split string for split {} : {}", split, encoded);
    return encoded;
}
Also used : ByteArrayDataOutput(com.google.common.io.ByteArrayDataOutput)

Example 29 with ByteArrayDataOutput

use of com.google.common.io.ByteArrayDataOutput in project oxAuth by GluuFederation.

the class RawAuthenticationService method packBytesToSign.

private byte[] packBytesToSign(byte[] appIdHash, byte userPresence, long counter, byte[] challengeHash) {
    ByteArrayDataOutput encoded = ByteStreams.newDataOutput();
    encoded.write(appIdHash);
    encoded.write(userPresence);
    encoded.writeInt((int) counter);
    encoded.write(challengeHash);
    return encoded.toByteArray();
}
Also used : ByteArrayDataOutput(com.google.common.io.ByteArrayDataOutput)

Example 30 with ByteArrayDataOutput

use of com.google.common.io.ByteArrayDataOutput in project oxAuth by GluuFederation.

the class RawRegistrationService method packBytesToSign.

private byte[] packBytesToSign(byte[] appIdHash, byte[] clientDataHash, byte[] keyHandle, byte[] userPublicKey) {
    ByteArrayDataOutput encoded = ByteStreams.newDataOutput();
    encoded.write(REGISTRATION_SIGNED_RESERVED_BYTE_VALUE);
    encoded.write(appIdHash);
    encoded.write(clientDataHash);
    encoded.write(keyHandle);
    encoded.write(userPublicKey);
    return encoded.toByteArray();
}
Also used : ByteArrayDataOutput(com.google.common.io.ByteArrayDataOutput)

Aggregations

ByteArrayDataOutput (com.google.common.io.ByteArrayDataOutput)39 IOException (java.io.IOException)3 ConnectorTableHandle (com.facebook.presto.spi.ConnectorTableHandle)2 Test (org.testng.annotations.Test)2 Split (co.cask.cdap.api.data.batch.Split)1 RaptorColumnHandle (com.facebook.presto.raptor.RaptorColumnHandle)1 RaptorColumnIdentity (com.facebook.presto.raptor.RaptorColumnIdentity)1 RaptorTableIdentity (com.facebook.presto.raptor.RaptorTableIdentity)1 ColumnHandle (com.facebook.presto.spi.ColumnHandle)1 ColumnIdentity (com.facebook.presto.spi.ColumnIdentity)1 TableIdentity (com.facebook.presto.spi.TableIdentity)1 JsonValue (com.fasterxml.jackson.annotation.JsonValue)1 Supplier (com.google.common.base.Supplier)1 ByteString (com.google.protobuf.ByteString)1 ServiceException (com.google.protobuf.ServiceException)1 InputRow (io.druid.data.input.InputRow)1 MapBasedInputRow (io.druid.data.input.MapBasedInputRow)1 ParseException (io.druid.java.util.common.parsers.ParseException)1 Aggregator (io.druid.query.aggregation.Aggregator)1 AggregatorFactory (io.druid.query.aggregation.AggregatorFactory)1