1
/*******************************************************************************
2
* Copyright (c) 2009 STMicroelectronics.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* Xavier Raynaud <xavier.raynaud@st.com> - initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.linuxtools.internal.gcov.utils;
13
import java.io.DataInput;
14
import java.io.IOException;
16
public class GcovStringReader {
19
public static String readString(DataInput stream) throws IOException {
20
String res = "NULL string";
21
long length = stream.readInt()&MasksGenerator.UNSIGNED_INT_MASK;
23
int ln = ((int) length) << 2;
24
byte[] name = new byte[ln];
25
stream.readFully(name);
26
StringBuffer sb = new StringBuffer();
27
for(int j=0; j < ln; j++){
29
char c = (char) name[j];