Spring for Apache Hadoop

org.springframework.data.hadoop.store.support
Class StoreUtils

java.lang.Object
  extended by org.springframework.data.hadoop.store.support.StoreUtils

public abstract class StoreUtils
extends java.lang.Object

Utility methods for store package.

Author:
Janne Valkealahti

Field Summary
static int BUFFER_SIZE
           
 
Constructor Summary
StoreUtils()
           
 
Method Summary
static int copy(java.io.InputStream in, DataStoreWriter<byte[]> out)
          Copy the contents of the given InputStream to the given DataStoreWriter.
static int copyStream(java.io.InputStream in, DataStoreWriter<byte[]> out)
          Copy the contents of the given InputStream to the given DataStoreWriter.
static byte[] getUTF8CsvDelimiter()
          Gets the default utf8 csv delimiter.
static byte[] getUTF8DefaultDelimiter()
          Gets the default utf8 delimiter.
static byte[] getUTF8TabDelimiter()
          Gets the default utf8 tab delimiter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

public static final int BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

StoreUtils

public StoreUtils()
Method Detail

getUTF8DefaultDelimiter

public static byte[] getUTF8DefaultDelimiter()
Gets the default utf8 delimiter.

Returns:
the default delimiter

getUTF8CsvDelimiter

public static byte[] getUTF8CsvDelimiter()
Gets the default utf8 csv delimiter.

Returns:
the default csv delimiter

getUTF8TabDelimiter

public static byte[] getUTF8TabDelimiter()
Gets the default utf8 tab delimiter.

Returns:
the default tab delimiter

copy

public static int copy(java.io.InputStream in,
                       DataStoreWriter<byte[]> out)
                throws java.io.IOException
Copy the contents of the given InputStream to the given DataStoreWriter. Closes stream and writer when done.

Parameters:
in - the input stream
out - the data store writer
Returns:
the number of bytes copied
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

copyStream

public static int copyStream(java.io.InputStream in,
                             DataStoreWriter<byte[]> out)
                      throws java.io.IOException
Copy the contents of the given InputStream to the given DataStoreWriter. Does not close stream or writer when done.

Parameters:
in - the input stream
out - the data store writer
Returns:
the number of bytes copied
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

Spring for Apache Hadoop