private synchronized String bufToString() throws UnsupportedEncodingException {

		if (baos.size() == 0) {
			return "";
		}

		byte[] bytes = baos.toByteArray();
		for (int i = 0; i < bytes.length / 2; i++) {
			byte t = bytes[i];
			bytes[i] = bytes[bytes.length - i - 1];
			bytes[bytes.length - i - 1] = t;
		}

		// Make sure to call reset so we effectively clear the outputs stream.
		baos.reset();

		// And return the new string.
		return new String(bytes, encoding);
	}
Converts the contents of the output stream to a string.

@return
@throws UnsupportedEncodingException
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/logviewer/model/ReverseLineReader.java