Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91d56c6b authored by Neil Fuller's avatar Neil Fuller Committed by Android (Google) Code Review
Browse files

Merge "Remove usage of StringFactory"

parents 0bbed11d 39568a24
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -737,8 +737,7 @@ public final class ProtoInputStream extends ProtoStream {
        fillBuffer();
        fillBuffer();
        if (mOffset + n <= mEnd) {
        if (mOffset + n <= mEnd) {
            // fast path read. String is well within the current buffer
            // fast path read. String is well within the current buffer
            String value = StringFactory.newStringFromBytes(mBuffer, mOffset, n,
            String value = new String(mBuffer, mOffset, n, StandardCharsets.UTF_8);
                    StandardCharsets.UTF_8);
            incOffset(n);
            incOffset(n);
            return value;
            return value;
        } else if (n <= mBufferSize) {
        } else if (n <= mBufferSize) {
@@ -752,14 +751,13 @@ public final class ProtoInputStream extends ProtoStream {
            mDiscardedBytes += mOffset;
            mDiscardedBytes += mOffset;
            mOffset = 0;
            mOffset = 0;


            String value = StringFactory.newStringFromBytes(mBuffer, mOffset, n,
            String value = new String(mBuffer, mOffset, n, StandardCharsets.UTF_8);
                    StandardCharsets.UTF_8);
            incOffset(n);
            incOffset(n);
            return value;
            return value;
        }
        }
        // Otherwise, the string is too large to use the buffer. Create the string from a
        // Otherwise, the string is too large to use the buffer. Create the string from a
        // separate byte array.
        // separate byte array.
        return StringFactory.newStringFromBytes(readRawBytes(n), 0, n, StandardCharsets.UTF_8);
        return new String(readRawBytes(n), 0, n, StandardCharsets.UTF_8);
    }
    }


    /**
    /**