Java Code Examples for org.apache.avro.util.Utf8#setByteLength()

The following examples show how to use org.apache.avro.util.Utf8#setByteLength() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataInputDecoder.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Override
public Utf8 readString(Utf8 old) throws IOException {
	int length = readInt();
	Utf8 result = (old != null ? old : new Utf8());
	result.setByteLength(length);

	if (length > 0) {
		in.readFully(result.getBytes(), 0, length);
	}

	return result;
}
 
Example 2
Source File: DataInputDecoder.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public Utf8 readString(Utf8 old) throws IOException {
	int length = readInt();
	Utf8 result = (old != null ? old : new Utf8());
	result.setByteLength(length);

	if (length > 0) {
		in.readFully(result.getBytes(), 0, length);
	}

	return result;
}
 
Example 3
Source File: DataInputDecoder.java    From flink with Apache License 2.0 5 votes vote down vote up
@Override
public Utf8 readString(Utf8 old) throws IOException {
	int length = readInt();
	Utf8 result = (old != null ? old : new Utf8());
	result.setByteLength(length);

	if (length > 0) {
		in.readFully(result.getBytes(), 0, length);
	}

	return result;
}
 
Example 4
Source File: DataInputDecoder.java    From stratosphere with Apache License 2.0 5 votes vote down vote up
@Override
public Utf8 readString(Utf8 old) throws IOException {
	int length = readInt();
	Utf8 result = (old != null ? old : new Utf8());
	result.setByteLength(length);
	
	if (length > 0) {
		in.readFully(result.getBytes(), 0, length);
	}
	
	return result;
}
 
Example 5
Source File: DataInputDecoder.java    From stratosphere with Apache License 2.0 5 votes vote down vote up
@Override
public Utf8 readString(Utf8 old) throws IOException {
	int length = readInt();
	Utf8 result = (old != null ? old : new Utf8());
	result.setByteLength(length);
	
	if (length > 0) {
		in.readFully(result.getBytes(), 0, length);
	}
	
	return result;
}