org.apache.hadoop.io.UTF8.readChars()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(117)

本文整理了Java中org.apache.hadoop.io.UTF8.readChars()方法的一些代码示例,展示了UTF8.readChars()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UTF8.readChars()方法的具体详情如下:
包路径:org.apache.hadoop.io.UTF8
类名称:UTF8
方法名:readChars

UTF8.readChars介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

/** Read a UTF-8 encoded string.
 *
 * @see DataInput#readUTF()
 */
public static String readString(DataInput in) throws IOException {
 int bytes = in.readUnsignedShort();
 StringBuilder buffer = new StringBuilder(bytes);
 readChars(in, buffer, bytes);
 return buffer.toString();
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/** Convert to a String. */
@Override
public String toString() {
 StringBuilder buffer = new StringBuilder(length);
 try {
  synchronized (IBUF) {
   IBUF.reset(bytes, length);
   readChars(IBUF, buffer, length);
  }
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return buffer.toString();
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Convert to a string, checking for valid UTF8.
 * @return the converted string
 * @throws UTFDataFormatException if the underlying bytes contain invalid
 * UTF8 data.
 */
public String toStringChecked() throws IOException {
 StringBuilder buffer = new StringBuilder(length);
 synchronized (IBUF) {
  IBUF.reset(bytes, length);
  readChars(IBUF, buffer, length);
 }
 return buffer.toString();
}

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Convert a UTF-8 encoded byte array back into a string.
 *
 * @throws IOException if the byte array is invalid UTF8
 */
public static String fromBytes(byte[] bytes) throws IOException {
 DataInputBuffer dbuf = new DataInputBuffer();
 dbuf.reset(bytes, 0, bytes.length);
 StringBuilder buf = new StringBuilder(bytes.length);
 readChars(dbuf, buf, bytes.length);
 return buf.toString();
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/** Read a UTF-8 encoded string.
 *
 * @see DataInput#readUTF()
 */
public static String readString(DataInput in) throws IOException {
 int bytes = in.readUnsignedShort();
 return readChars(in, bytes);
}

代码示例来源:origin: io.hops/hadoop-common

/** Read a UTF-8 encoded string.
 *
 * @see DataInput#readUTF()
 */
public static String readString(DataInput in) throws IOException {
 int bytes = in.readUnsignedShort();
 StringBuilder buffer = new StringBuilder(bytes);
 readChars(in, buffer, bytes);
 return buffer.toString();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/** Read a UTF-8 encoded string.
 *
 * @see DataInput#readUTF()
 */
public static String readString(DataInput in) throws IOException {
 int bytes = in.readUnsignedShort();
 StringBuilder buffer = new StringBuilder(bytes);
 readChars(in, buffer, bytes);
 return buffer.toString();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/** Read a UTF-8 encoded string.
 *
 * @see DataInput#readUTF()
 */
public static String readString(DataInput in) throws IOException {
 int bytes = in.readUnsignedShort();
 StringBuilder buffer = new StringBuilder(bytes);
 readChars(in, buffer, bytes);
 return buffer.toString();
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/** Read a UTF-8 encoded string.
 *
 * @see DataInput#readUTF()
 */
public static String readString(DataInput in) throws IOException {
 int bytes = in.readUnsignedShort();
 StringBuilder buffer = new StringBuilder(bytes);
 readChars(in, buffer, bytes);
 return buffer.toString();
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

/** Read a UTF-8 encoded string.
 *
 * @see DataInput#readUTF()
 */
public static String readString(DataInput in) throws IOException {
 int bytes = in.readUnsignedShort();
 StringBuffer buffer = new StringBuffer(bytes);
 readChars(in, buffer, bytes);
 return buffer.toString();
}

代码示例来源:origin: org.jvnet.hudson.hadoop/hadoop-core

/** Convert to a String. */
public String toString() {
 StringBuffer buffer = new StringBuffer(length);
 try {
  synchronized (IBUF) {
   IBUF.reset(bytes, length);
   readChars(IBUF, buffer, length);
  }
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return buffer.toString();
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/** Convert to a String. */
public String toString() {
 try {
  DataInputBuffer ibuf = IBUF_FACTORY.get();
  ibuf.reset(bytes, length);
  return readChars(ibuf, length);
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/** Convert to a String. */
@Override
public String toString() {
 StringBuilder buffer = new StringBuilder(length);
 try {
  synchronized (IBUF) {
   IBUF.reset(bytes, length);
   readChars(IBUF, buffer, length);
  }
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return buffer.toString();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Convert to a string, checking for valid UTF8.
 * @return the converted string
 * @throws UTFDataFormatException if the underlying bytes contain invalid
 * UTF8 data.
 */
public String toStringChecked() throws IOException {
 StringBuilder buffer = new StringBuilder(length);
 synchronized (IBUF) {
  IBUF.reset(bytes, length);
  readChars(IBUF, buffer, length);
 }
 return buffer.toString();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Convert to a string, checking for valid UTF8.
 * @return the converted string
 * @throws UTFDataFormatException if the underlying bytes contain invalid
 * UTF8 data.
 */
public String toStringChecked() throws IOException {
 StringBuilder buffer = new StringBuilder(length);
 synchronized (IBUF) {
  IBUF.reset(bytes, length);
  readChars(IBUF, buffer, length);
 }
 return buffer.toString();
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/** Convert to a String. */
@Override
public String toString() {
 StringBuilder buffer = new StringBuilder(length);
 try {
  synchronized (IBUF) {
   IBUF.reset(bytes, length);
   readChars(IBUF, buffer, length);
  }
 } catch (IOException e) {
  throw new RuntimeException(e);
 }
 return buffer.toString();
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Convert a UTF-8 encoded byte array back into a string.
 *
 * @throws IOException if the byte array is invalid UTF8
 */
public static String fromBytes(byte[] bytes) throws IOException {
 DataInputBuffer dbuf = new DataInputBuffer();
 dbuf.reset(bytes, 0, bytes.length);
 StringBuilder buf = new StringBuilder(bytes.length);
 readChars(dbuf, buf, bytes.length);
 return buf.toString();
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Convert a UTF-8 encoded byte array back into a string.
 *
 * @throws IOException if the byte array is invalid UTF8
 */
public static String fromBytes(byte[] bytes) throws IOException {
 DataInputBuffer dbuf = new DataInputBuffer();
 dbuf.reset(bytes, 0, bytes.length);
 StringBuilder buf = new StringBuilder(bytes.length);
 readChars(dbuf, buf, bytes.length);
 return buf.toString();
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * Convert a UTF-8 encoded byte array back into a string.
 *
 * @throws IOException if the byte array is invalid UTF8
 */
public static String fromBytes(byte[] bytes) throws IOException {
 DataInputBuffer dbuf = new DataInputBuffer();
 dbuf.reset(bytes, 0, bytes.length);
 StringBuilder buf = new StringBuilder(bytes.length);
 readChars(dbuf, buf, bytes.length);
 return buf.toString();
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * Convert a UTF-8 encoded byte array back into a string.
 *
 * @throws IOException if the byte array is invalid UTF8
 */
public static String fromBytes(byte[] bytes) throws IOException {
 DataInputBuffer dbuf = new DataInputBuffer();
 dbuf.reset(bytes, 0, bytes.length);
 StringBuilder buf = new StringBuilder(bytes.length);
 readChars(dbuf, buf, bytes.length);
 return buf.toString();
}

相关文章