/external/okhttp/okio/okio/src/test/java/okio/ |
D | ByteStringTest.java | 39 ByteString byteString = ByteString.of(bytes, 2, 9); in ofCopyRange() 46 ByteString byteString = ByteString.decodeHex("ab12"); in getByte() 52 ByteString byteString = ByteString.decodeHex("ab12"); in getByteOutOfBounds() 61 ByteString byteString = ByteString.decodeHex("000102"); in equals() 63 assertTrue(byteString.equals(ByteString.decodeHex("000102"))); in equals() 64 assertTrue(ByteString.of().equals(ByteString.EMPTY)); in equals() 65 assertTrue(ByteString.EMPTY.equals(ByteString.of())); in equals() 67 assertFalse(byteString.equals(ByteString.decodeHex("000201"))); in equals() 73 ByteString byteString = ByteString.encodeUtf8(bronzeHorseman); in utf8() 75 assertTrue(byteString.equals(ByteString.of(bronzeHorseman.getBytes(Util.UTF_8)))); in utf8() [all …]
|
D | Utf8Test.java | 120 buffer.write(ByteString.decodeHex("f888808080")); in readTooLargeCodepointReturnsReplacementCharacter() 132 buffer.write(ByteString.decodeHex("df20")); in readNonContinuationBytesReturnsReplacementCharacter() 141 buffer.write(ByteString.decodeHex("f4908080")); in readCodePointBeyondUnicodeMaximum() 148 buffer.write(ByteString.decodeHex("eda080")); in readSurrogateCodePoint() 151 buffer.write(ByteString.decodeHex("edbfbf")); in readSurrogateCodePoint() 159 buffer.write(ByteString.decodeHex("c080")); in readOverlongCodePoint() 200 assertEquals(buffer.readByteString(), ByteString.decodeHex(hex)); in assertCodePointEncoded() 204 Buffer buffer = new Buffer().write(ByteString.decodeHex(hex)); in assertCodePointDecoded() 212 ByteString expectedUtf8 = ByteString.decodeHex(hex); in assertStringEncoded() 215 ByteString platformUtf8 = ByteString.of(string.getBytes("UTF-8")); in assertStringEncoded() [all …]
|
/external/protobuf/java/core/src/test/java/com/google/protobuf/ |
D | ByteStringTest.java | 33 import com.google.protobuf.ByteString.Output; 93 ByteString substring = ByteString.copyFrom(bytes).substring(500); in testSubstring_BeginIndex() 100 ByteString byteString = ByteString.copyFrom(bytes, 500, 200); in testCopyFrom_BytesOffsetSize() 107 ByteString byteString = ByteString.copyFrom(bytes); in testCopyFrom_Bytes() 117 ByteString byteString = ByteString.copyFrom(byteBuffer, 200); in testCopyFrom_ByteBufferSize() 127 ByteString byteString = ByteString.copyFrom(byteBuffer); in testCopyFrom_ByteBuffer() 134 ByteString byteString = ByteString.copyFrom(testString, UTF_16); in testCopyFrom_StringEncoding() 142 ByteString byteString = ByteString.copyFromUtf8(testString); in testCopyFrom_Utf8() 150 final List<ByteString> pieces = makeConcretePieces(testBytes); in testCopyFrom_Iterable() 152 ByteString byteString = ByteString.copyFrom(pieces); in testCopyFrom_Iterable() [all …]
|
D | RopeByteStringTest.java | 57 Iterator<ByteString> iter = ByteStringTest.makeConcretePieces(referenceBytes).iterator(); in setUp() 77 ByteString concatenated = ByteString.EMPTY; in testBalance() 79 concatenated = concatenated.concat(ByteString.copyFrom(testBytes, i * pieceSize, pieceSize)); in testBalance() 86 ByteString testString = ByteString.copyFrom(testBytes); in testBalance() 98 ByteString sourceByteString = ByteString.copyFromUtf8(sourceString); in testToString() 103 ByteString unicode = ByteString.EMPTY; in testToString() 115 ByteString flatString = ByteString.copyFromUtf8(testString); in testToString() 124 ByteString sourceByteString = ByteString.copyFromUtf8(sourceString); in testCharsetToString() 129 ByteString unicode = ByteString.EMPTY; in testCharsetToString() 141 ByteString flatString = ByteString.copyFromUtf8(testString); in testCharsetToString() [all …]
|
D | RopeByteStringSubstringTest.java | 48 Iterator<ByteString> iter = ByteStringTest.makeConcretePieces(sourceBytes).iterator(); in setUp() 49 ByteString sourceString = iter.next(); in setUp() 71 ByteString sourceByteString = ByteString.copyFromUtf8(sourceString); in testToString() 76 ByteString unicode = ByteString.EMPTY; in testToString() 92 ByteString flatString = ByteString.copyFromUtf8(testString); in testToString() 101 ByteString sourceByteString = ByteString.copyFromUtf8(sourceString); in testCharsetToString() 106 ByteString unicode = ByteString.EMPTY; in testCharsetToString() 122 ByteString flatString = ByteString.copyFromUtf8(testString); in testCharsetToString()
|
D | UnmodifiableLazyStringListTest.java | 50 private static ByteString BYTE_STRING_A = ByteString.copyFromUtf8("A"); 51 private static ByteString BYTE_STRING_B = ByteString.copyFromUtf8("B"); 52 private static ByteString BYTE_STRING_C = ByteString.copyFromUtf8("C"); 65 List<ByteString> byteStringList = list.asByteStringList(); in testReadOnlyMethods() 99 List<ByteString> byteStringList = list.asByteStringList(); in testModifyMethods() 146 List<ByteString> byteStringList = list.asByteStringList(); in testIterator() 147 Iterator<ByteString> byteIter = byteStringList.iterator(); in testIterator() 192 List<ByteString> byteStringList = list.asByteStringList(); in testListIterator() 193 ListIterator<ByteString> byteIter = byteStringList.listIterator(); in testListIterator()
|
D | IsValidUtf8Test.java | 147 ByteString leaf = factory.newByteString(realBytes); in assertValidUtf8() 148 ByteString sub = leaf.substring(0, bytes.length); in assertValidUtf8() 151 ByteString[] ropes = { in assertValidUtf8() 152 RopeByteString.newInstanceForTest(ByteString.EMPTY, leaf), in assertValidUtf8() 153 RopeByteString.newInstanceForTest(ByteString.EMPTY, sub), in assertValidUtf8() 154 RopeByteString.newInstanceForTest(leaf, ByteString.EMPTY), in assertValidUtf8() 155 RopeByteString.newInstanceForTest(sub, ByteString.EMPTY), in assertValidUtf8() 157 for (ByteString rope : ropes) { in assertValidUtf8() 174 private static ByteString asBytes(String s) { in asBytes() 175 return ByteString.copyFromUtf8(s); in asBytes()
|
D | NioByteStringTest.java | 56 private static final ByteString EMPTY = new NioByteString(ByteBuffer.wrap(new byte[0])); 59 private static final int EXPECTED_HASH = ByteString.wrap(BYTES).hashCode(); 62 private final ByteString testString = new NioByteString(backingBuffer); 85 ByteString.ByteIterator iter = testString.iterator(); in testByteIterator() 403 ByteString.Output output = ByteString.newOutput(); in testNewOutput() 424 ByteString unicode = forString(testString); in testToString() 431 ByteString unicode = forString(testString); in testCharsetToString() 474 ByteString literal = ByteString.copyFrom(BYTES); in testEqualsLiteralByteString() 480 testString.equals(ByteString.EMPTY)); in testEqualsLiteralByteString() 482 ByteString.EMPTY, testString.substring(55, 55)); in testEqualsLiteralByteString() [all …]
|
D | BoundedByteStringTest.java | 55 stringUnderTest = ByteString.copyFrom(sourceBytes).substring(from, to); in setUp() 64 ByteString unicode = ByteString.wrap(testString.getBytes(Internal.UTF_8)); in testToString() 65 ByteString chopped = unicode.substring(2, unicode.size() - 6); in testToString() 77 ByteString unicode = ByteString.wrap(testString.getBytes(Internal.UTF_8)); in testCharsetToString() 78 ByteString chopped = unicode.substring(2, unicode.size() - 6); in testCharsetToString() 97 assertTrue("Didn't get a ByteString back", o instanceof ByteString); in testJavaSerialization()
|
D | WireFormatTest.java | 63 ByteString rawBytes = message.toByteString(); in testSerialization() 74 ByteString rawBytes = message.toByteString(); in testSerializationPacked() 88 ByteString rawBytes = message.toByteString(); in testSerializeExtensions() 100 ByteString rawBytes = message.toByteString(); in testSerializePackedExtensions() 103 ByteString rawBytes2 = message2.toByteString(); in testSerializePackedExtensions() 136 ByteString rawBytes = message.toByteString(); in testSerializeExtensionsLite() 148 ByteString rawBytes = message.toByteString(); in testSerializePackedExtensionsLite() 151 ByteString rawBytes2 = message2.toByteString(); in testSerializePackedExtensionsLite() 162 ByteString rawBytes = message.toByteString(); in testParseExtensions() 175 ByteString rawBytes = message.toByteString(); in testParsePackedExtensions() [all …]
|
D | LazyStringEndToEndTest.java | 48 private static ByteString TEST_ALL_TYPES_SERIALIZED_WITH_ILLEGAL_UTF8 = 49 ByteString.copyFrom(new byte[] { 53 private ByteString encodedTestAllTypes; 73 ByteString bytes = tV2.toByteString(); in testParseAndSerialize() 90 ByteString.copyFrom(sink)); in testParseAndWrite() 121 ByteString optional = proto.getOptionalStringBytes(); in testNoStringCachingIfOnlyBytesAccessed() 125 ByteString repeated0 = proto.getRepeatedStringBytes(0); in testNoStringCachingIfOnlyBytesAccessed() 126 ByteString repeated1 = proto.getRepeatedStringBytes(1); in testNoStringCachingIfOnlyBytesAccessed()
|
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/framed/ |
D | Header.java | 3 import okio.ByteString; 8 public static final ByteString RESPONSE_STATUS = ByteString.encodeUtf8(":status"); 9 public static final ByteString TARGET_METHOD = ByteString.encodeUtf8(":method"); 10 public static final ByteString TARGET_PATH = ByteString.encodeUtf8(":path"); 11 public static final ByteString TARGET_SCHEME = ByteString.encodeUtf8(":scheme"); 12 public static final ByteString TARGET_AUTHORITY = ByteString.encodeUtf8(":authority"); // HTTP/2 13 public static final ByteString TARGET_HOST = ByteString.encodeUtf8(":host"); // spdy/3 14 public static final ByteString VERSION = ByteString.encodeUtf8(":version"); // spdy/3 17 public final ByteString name; 19 public final ByteString value; [all …]
|
D | Hpack.java | 27 import okio.ByteString; 245 ByteString name = getName(index); in readLiteralHeaderWithoutIndexingIndexedName() 246 ByteString value = readByteString(); in readLiteralHeaderWithoutIndexingIndexedName() 251 ByteString name = checkLowercase(readByteString()); in readLiteralHeaderWithoutIndexingNewName() 252 ByteString value = readByteString(); in readLiteralHeaderWithoutIndexingNewName() 258 ByteString name = getName(nameIndex); in readLiteralHeaderWithIncrementalIndexingIndexedName() 259 ByteString value = readByteString(); in readLiteralHeaderWithIncrementalIndexingIndexedName() 264 ByteString name = checkLowercase(readByteString()); in readLiteralHeaderWithIncrementalIndexingNewName() 265 ByteString value = readByteString(); in readLiteralHeaderWithIncrementalIndexingNewName() 269 private ByteString getName(int index) { in getName() [all …]
|
/external/protobuf/csharp/src/Google.Protobuf.Test/ |
D | ByteStringTest.cs | 44 ByteString b1 = ByteString.CopyFrom(1, 2, 3); in Equality() 45 ByteString b2 = ByteString.CopyFrom(1, 2, 3); in Equality() 46 ByteString b3 = ByteString.CopyFrom(1, 2, 4); in Equality() 47 ByteString b4 = ByteString.CopyFrom(1, 2, 3, 4); in Equality() 59 Assert.IsTrue((ByteString) null == null); in Equality() 66 Assert.IsFalse((ByteString) null != null); in Equality() 72 Assert.AreEqual(0, ByteString.Empty.Length); in EmptyByteStringHasZeroSize() 78 ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode); in CopyFromStringWithExplicitEncoding() 89 Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty); in IsEmptyWhenEmpty() 95 Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty); in IsEmptyWhenNotEmpty() [all …]
|
/external/protobuf/csharp/src/Google.Protobuf/ |
D | ByteString.cs | 44 public sealed class ByteString : IEnumerable<byte>, IEquatable<ByteString> class 46 private static readonly ByteString empty = new ByteString(new byte[0]); 59 internal static ByteString FromBytes(byte[] bytes) in FromBytes() 61 return new ByteString(bytes); in FromBytes() 68 internal static byte[] GetBuffer(ByteString bytes) in GetBuffer() 77 internal static ByteString AttachBytes(byte[] bytes) in AttachBytes() 79 return new ByteString(bytes); in AttachBytes() 86 private ByteString(byte[] bytes) in ByteString() method in Google.Protobuf.ByteString 94 public static ByteString Empty 137 public static ByteString FromBase64(string bytes) in FromBase64() [all …]
|
/external/okhttp/okhttp-ws-tests/src/test/java/com/squareup/okhttp/internal/ws/ |
D | WebSocketReaderTest.java | 28 import okio.ByteString; 52 data.write(ByteString.decodeHex("0a00")); // Empty ping. in controlFramesMustBeFinal() 62 data.write(ByteString.decodeHex("9a00")); // Empty ping, flag 1 set. in reservedFlagsAreUnsupported() 70 data.write(ByteString.decodeHex("aa00")); // Empty ping, flag 2 set. in reservedFlagsAreUnsupported() 78 data.write(ByteString.decodeHex("ca00")); // Empty ping, flag 3 set. in reservedFlagsAreUnsupported() 88 data.write(ByteString.decodeHex("8100")); in clientSentFramesMustBeMasked() 98 data.write(ByteString.decodeHex("8180")); in serverSentFramesMustNotBeMasked() 108 data.write(ByteString.decodeHex("8a7e007e")); in controlFramePayloadMax() 118 data.write(ByteString.decodeHex("810548656c6c6f")); // Hello in clientSimpleHello() 124 data.write(ByteString.decodeHex("818537fa213d7f9f4d5158")); // Hello in serverSimpleHello() [all …]
|
/external/okhttp/okio/okio/src/main/java/okio/ |
D | ByteString.java | 46 public class ByteString implements Serializable, Comparable<ByteString> { class 52 public static final ByteString EMPTY = ByteString.of(); 58 ByteString(byte[] data) { in ByteString() method in ByteString 65 public static ByteString of(byte... data) { in of() 67 return new ByteString(data.clone()); in of() 74 public static ByteString of(byte[] data, int offset, int byteCount) { in of() 80 return new ByteString(copy); in of() 84 public static ByteString encodeUtf8(String s) { in encodeUtf8() 86 ByteString byteString = new ByteString(s.getBytes(Util.UTF_8)); in encodeUtf8() 108 public ByteString md5() { in md5() [all …]
|
D | SegmentedByteString.java | 50 final class SegmentedByteString extends ByteString { 96 @Override public ByteString toAsciiLowercase() { in toAsciiLowercase() 100 @Override public ByteString toAsciiUppercase() { in toAsciiUppercase() 104 @Override public ByteString md5() { in md5() 108 @Override public ByteString sha256() { in sha256() 116 @Override public ByteString substring(int beginIndex) { in substring() 120 @Override public ByteString substring(int beginIndex, int endIndex) { in substring() 185 int offset, ByteString other, int otherOffset, int byteCount) { in rangeEquals() 220 private ByteString toByteString() { in toByteString() 221 return new ByteString(toByteArray()); in toByteString() [all …]
|
/external/protobuf/java/core/src/main/java/com/google/protobuf/ |
D | ByteString.java | 68 public abstract class ByteString implements Iterable<Byte>, Serializable { class 89 public static final ByteString EMPTY = new LiteralByteString(Internal.EMPTY_BYTE_ARRAY); 147 ByteString() {} in ByteString() method in ByteString 244 public final ByteString substring(int beginIndex) { in substring() 258 public abstract ByteString substring(int beginIndex, int endIndex); in substring() 269 public final boolean startsWith(ByteString prefix) { in startsWith() 283 public final boolean endsWith(ByteString suffix) { in endsWith() 299 public static ByteString copyFrom(byte[] bytes, int offset, int size) { in copyFrom() 309 public static ByteString copyFrom(byte[] bytes) { in copyFrom() 317 static ByteString wrap(byte[] bytes) { in wrap() [all …]
|
D | RopeByteString.java | 73 final class RopeByteString extends ByteString { 118 private final ByteString left; 119 private final ByteString right; 132 private RopeByteString(ByteString left, ByteString right) { in RopeByteString() 155 static ByteString concatenate(ByteString left, ByteString right) { in concatenate() 165 if (newLength < ByteString.CONCATENATE_BY_COPY_SIZE) { in concatenate() 184 ByteString newRight = concatenateBytes(leftRope.right, right); in concatenate() 195 ByteString newRight = new RopeByteString(leftRope.right, right); in concatenate() 218 private static ByteString concatenateBytes(ByteString left, in concatenateBytes() 219 ByteString right) { in concatenateBytes() [all …]
|
D | LazyStringArrayList.java | 118 } else if (o instanceof ByteString) { in get() 119 ByteString bs = (ByteString) o; in get() 154 private void add(int index, ByteString element) { in add() 188 public boolean addAllByteString(Collection<? extends ByteString> values) { in addAllByteString() 219 public void add(ByteString element) { in add() 238 public ByteString getByteString(int index) { in getByteString() 240 ByteString b = asByteString(o); in getByteString() 258 public void set(int index, ByteString s) { in set() 262 private Object setAndReturn(int index, ByteString s) { in setAndReturn() 280 } else if (o instanceof ByteString) { in asString() [all …]
|
D | LazyFieldLite.java | 90 private ByteString delayedBytes; 111 private volatile ByteString memoizedBytes; 116 public LazyFieldLite(ExtensionRegistryLite extensionRegistry, ByteString bytes) { in LazyFieldLite() 179 return memoizedBytes == ByteString.EMPTY in containsDefaultInstance() 180 || value == null && (delayedBytes == null || delayedBytes == ByteString.EMPTY); in containsDefaultInstance() 353 MessageLite value, ByteString otherBytes, ExtensionRegistryLite extensionRegistry) { in mergeValueAndBytes() 366 public void setByteString(ByteString bytes, ExtensionRegistryLite extensionRegistry) { in setByteString() 396 public ByteString toByteString() { in toByteString() 410 memoizedBytes = ByteString.EMPTY; in toByteString() 438 this.memoizedBytes = ByteString.EMPTY; in ensureInitialized() [all …]
|
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/http/ |
D | Http2xStream.java | 37 import okio.ByteString; 53 private static final ByteString CONNECTION = ByteString.encodeUtf8("connection"); 54 private static final ByteString HOST = ByteString.encodeUtf8("host"); 55 private static final ByteString KEEP_ALIVE = ByteString.encodeUtf8("keep-alive"); 56 private static final ByteString PROXY_CONNECTION = ByteString.encodeUtf8("proxy-connection"); 57 private static final ByteString TRANSFER_ENCODING = ByteString.encodeUtf8("transfer-encoding"); 58 private static final ByteString TE = ByteString.encodeUtf8("te"); 59 private static final ByteString ENCODING = ByteString.encodeUtf8("encoding"); 60 private static final ByteString UPGRADE = ByteString.encodeUtf8("upgrade"); 63 private static final List<ByteString> SPDY_3_SKIPPED_REQUEST_HEADERS = Util.immutableList( [all …]
|
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ |
D | CertificatePinner.java | 28 import okio.ByteString; 135 private final Map<String, Set<ByteString>> hostnameToPins; 153 Set<ByteString> pins = findMatchingPins(hostname); in check() 172 for (ByteString pin : pins) { in check() 188 Set<ByteString> findMatchingPins(String hostname) { in findMatchingPins() 189 Set<ByteString> directPins = hostnameToPins.get(hostname); in findMatchingPins() 190 Set<ByteString> wildcardPins = null; in findMatchingPins() 206 Set<ByteString> pins = new LinkedHashSet<>(); in findMatchingPins() 229 private static ByteString sha1(X509Certificate x509Certificate) { in sha1() 230 return Util.sha1(ByteString.of(x509Certificate.getPublicKey().getEncoded())); in sha1() [all …]
|
/external/protobuf/ruby/src/main/java/com/google/protobuf/jruby/ |
D | SentinelOuterClass.java | 74 com.google.protobuf.ByteString 95 com.google.protobuf.ByteString getDefaultBytes(); in getDefaultBytes() 117 defaultBytes_ = com.google.protobuf.ByteString.EMPTY; in Sentinel() 207 com.google.protobuf.ByteString bs = in getDefaultString() 208 (com.google.protobuf.ByteString) ref; in getDefaultString() 219 public com.google.protobuf.ByteString 223 com.google.protobuf.ByteString b = in getDefaultStringBytes() 224 com.google.protobuf.ByteString.copyFromUtf8( in getDefaultStringBytes() 229 return (com.google.protobuf.ByteString) ref; in getDefaultStringBytes() 261 private com.google.protobuf.ByteString defaultBytes_; [all …]
|