コード例 #1
0
int FileDecoder::get_bytes(ArrayPointer* destination, int count JVM_TRAPS) {
  UsingFastOops fast_oops;
  JarFileParser::Fast jfp = get_jar_parser_if_needed(JVM_SINGLE_ARG_CHECK_0);
  (void)jfp;

  if (count > bytes_remain()) {
    count = bytes_remain();
  }
  int result = !is_inflater() ?
    get_bytes_raw(destination->base_address(), count) :
    ((Inflater*) this)->get_bytes(destination, count JVM_NO_CHECK_AT_BOTTOM);

  set_bytes_remain(bytes_remain() - result);
  return result;
}
コード例 #2
0
ReturnOop FileDecoder::read_completely0(JVM_SINGLE_ARG_TRAPS) {
  UsingFastOops fast_oops;
  JarFileParser::Fast jfp = get_jar_parser_if_needed(JVM_SINGLE_ARG_CHECK_0);
  (void)jfp;
  TypeArray::Fast result;
  if (is_inflater()) {
    result = ((Inflater*) this)->
             read_completely(JVM_SINGLE_ARG_NO_CHECK_AT_BOTTOM);
  } else {
    int size = file_size();
    result = Universe::new_byte_array_raw(size JVM_CHECK_0);
    int actual_bytes = get_bytes_raw(result().base_address(), size);
    if (actual_bytes != size) {
      result = (ReturnOop) NULL;
    }
  }

  return result;
}
コード例 #3
0
int
ReliSock::get_line_raw( char *buffer, int length )
{
	int total=0;
	int actual;

	while( length>0 ) {
		actual = get_bytes_raw(buffer,1);
		if(actual<=0) break;
		if(*buffer=='\n') break;

		buffer++;
		length--;
		total++;
	}
	
	*buffer = 0;
	return total;
}