List of usage examples for org.apache.hadoop.io InputBuffer reset
public void reset(byte[] input, int start, int length)
From source file:com.asakusafw.runtime.value.StringOptionUtil.java
License:Apache License
/** * Returns a {@link Reader} to read the text contents in the {@link StringOption}. * @param option the target {@link StringOption} * @return the created reader/*from w w w. j av a 2s . c om*/ * @throws NullPointerException if the {@link StringOption} is/represents {@code null} */ public static Reader asReader(StringOption option) { Text text = option.get(); InputBuffer buffer = new InputBuffer(); buffer.reset(text.getBytes(), 0, text.getLength()); return new InputStreamReader(buffer, ENCODING); }