/external/okhttp/okio/okio/src/test/java/okio/ |
D | ByteStringTest.java | 35 ByteString byteString = ByteString.of(bytes, 2, 9); in ofCopyRange() 42 ByteString byteString = ByteString.decodeHex("ab12"); in getByte() 48 ByteString byteString = ByteString.decodeHex("ab12"); in getByteOutOfBounds() 57 ByteString byteString = ByteString.decodeHex("000102"); in equals() 59 assertTrue(byteString.equals(ByteString.decodeHex("000102"))); in equals() 60 assertTrue(ByteString.of().equals(ByteString.EMPTY)); in equals() 61 assertTrue(ByteString.EMPTY.equals(ByteString.of())); in equals() 63 assertFalse(byteString.equals(ByteString.decodeHex("000201"))); in equals() 69 ByteString byteString = ByteString.encodeUtf8(bronzeHorseman); in utf8() 71 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 …]
|
D | GzipSourceTest.java | 40 ByteString gzipHeader = gzipHeaderWithFlags((byte) 0x02); in gunzip_withHCRC() 155 .write(ByteString.decodeHex("1f8b08000000000000004b4c4a0600c241243503000000")); // 'abc' in gunzipExhaustsSource() 170 .write(ByteString.decodeHex("1f8b08000000000000004b4c4a0600c241243503000000")); // 'abc' in gunzipThrowsIfSourceIsNotExhausted() 185 private ByteString gzipHeaderWithFlags(byte flags) { in gzipHeaderWithFlags() 188 return ByteString.of(result); in gzipHeaderWithFlags() 191 private final ByteString gzipHeader = ByteString.decodeHex("1f8b0800000000000000"); 194 private final ByteString deflated = ByteString.decodeHex( 197 private final ByteString gzipTrailer = ByteString.decodeHex(""
|
D | SegmentSharingTest.java | 34 ByteString snapshot = new Buffer().snapshot(); in snapshotOfEmptyBuffer() 35 assertEquivalent(snapshot, ByteString.EMPTY); in snapshotOfEmptyBuffer() 39 ByteString byteString = concatenateBuffers(xs, ys, zs).snapshot(); in snapshotsAreEquivalent() 42 assertEquivalent(byteString, ByteString.encodeUtf8(xs + ys + zs)); in snapshotsAreEquivalent() 46 ByteString byteString = concatenateBuffers(xs, ys, zs).snapshot(); in snapshotGetByte() 66 ByteString byteString = concatenateBuffers(xs, ys, zs).snapshot(); in snapshotWriteToOutputStream() 78 ByteString snapshot = buffer.snapshot(); in snapshotSegmentsAreNotRecycled() 110 ByteString byteString = concatenateBuffers(xs, ys, zs).snapshot(); in snapshotJavaSerialization() 147 ByteString snapshot = bufferA.snapshot(); // Share the segment. in shareAndSplit() 156 ByteString snapshot = bufferA.snapshot(); in appendSnapshotToEmptyBuffer() [all …]
|
D | TestUtil.java | 40 static ByteString randomBytes(int length) { in randomBytes() 44 return ByteString.of(randomBytes); in randomBytes() 53 public static void assertEquivalent(ByteString b1, ByteString b2) { in assertEquivalent() 79 ByteString b3 = new ByteString(b3Bytes); in assertEquivalent() 83 ByteString b3 = ByteString.encodeUtf8("a"); in assertEquivalent()
|
/external/protobuf/java/src/test/java/com/google/protobuf/ |
D | ByteStringTest.java | 33 import com.google.protobuf.ByteString.Output; 92 ByteString substring = ByteString.copyFrom(bytes).substring(500); in testSubstring_BeginIndex() 99 ByteString byteString = ByteString.copyFrom(bytes, 500, 200); in testCopyFrom_BytesOffsetSize() 106 ByteString byteString = ByteString.copyFrom(bytes); in testCopyFrom_Bytes() 116 ByteString byteString = ByteString.copyFrom(byteBuffer, 200); in testCopyFrom_ByteBufferSize() 126 ByteString byteString = ByteString.copyFrom(byteBuffer); in testCopyFrom_ByteBuffer() 133 ByteString byteString = ByteString.copyFrom(testString, UTF_16); in testCopyFrom_StringEncoding() 141 ByteString byteString = ByteString.copyFromUtf8(testString); in testCopyFrom_Utf8() 149 final List<ByteString> pieces = makeConcretePieces(testBytes); in testCopyFrom_Iterable() 151 ByteString byteString = ByteString.copyFrom(pieces); in testCopyFrom_Iterable() [all …]
|
D | IsValidUtf8Test.java | 135 private ByteString toByteString(int... bytes) { in toByteString() 136 return ByteString.copyFrom(toByteArray(bytes)); in toByteString() 143 ByteString lit = ByteString.copyFrom(realBytes); in assertValidUtf8() 144 ByteString sub = lit.substring(0, bytes.length); in assertValidUtf8() 147 ByteString[] ropes = { in assertValidUtf8() 148 RopeByteString.newInstanceForTest(ByteString.EMPTY, lit), in assertValidUtf8() 149 RopeByteString.newInstanceForTest(ByteString.EMPTY, sub), in assertValidUtf8() 150 RopeByteString.newInstanceForTest(lit, ByteString.EMPTY), in assertValidUtf8() 151 RopeByteString.newInstanceForTest(sub, ByteString.EMPTY), in assertValidUtf8() 154 for (ByteString rope : ropes) { in assertValidUtf8() [all …]
|
D | RopeByteStringTest.java | 52 Iterator<ByteString> iter = ByteStringTest.makeConcretePieces(referenceBytes).iterator(); in setUp() 72 ByteString concatenated = ByteString.EMPTY; in testBalance() 74 concatenated = concatenated.concat(ByteString.copyFrom(testBytes, i * pieceSize, pieceSize)); in testBalance() 81 ByteString testString = ByteString.copyFrom(testBytes); in testBalance() 93 ByteString sourceByteString = ByteString.copyFromUtf8(sourceString); in testToString() 98 ByteString unicode = ByteString.EMPTY; in testToString() 110 ByteString flatString = ByteString.copyFromUtf8(testString); in testToString()
|
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 | 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()
|
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() 132 ByteString optional = proto.getOptionalStringBytes(); in testNoStringCachingIfOnlyBytesAccessed() 136 ByteString repeated0 = proto.getRepeatedStringBytes(0); in testNoStringCachingIfOnlyBytesAccessed() 137 ByteString repeated1 = proto.getRepeatedStringBytes(1); in testNoStringCachingIfOnlyBytesAccessed()
|
D | LazyStringArrayListTest.java | 49 private static ByteString BYTE_STRING_A = ByteString.copyFromUtf8("A"); 50 private static ByteString BYTE_STRING_B = ByteString.copyFromUtf8("B"); 51 private static ByteString BYTE_STRING_C = ByteString.copyFromUtf8("C"); 71 List<ByteString> byteStringList = list.asByteStringList(); in testJustStrings() 95 List<ByteString> byteStringList = list.asByteStringList(); in testJustByteString() 123 ByteString aPrimeByteString = list.getByteString(0); in testConversionBackAndForth() 125 ByteString bPrimeByteString = list.getByteString(1); in testConversionBackAndForth()
|
D | CheckUtf8Test.java | 48 private static final ByteString UTF8_BYTE_STRING = 49 ByteString.copyFromUtf8(UTF8_BYTE_STRING_TEXT); 50 private static final ByteString NON_UTF8_BYTE_STRING = 51 ByteString.copyFrom(new byte[]{(byte) 0x80}); // A lone continuation byte. 59 ByteString serialized = in testParseRequiredStringWithGoodUtf8() 93 ByteString serialized = in testParseRequiredStringWithBadUtf8() 131 ByteString serialized = in testParseRequiredStringWithBadUtf8Size()
|
D | UnknownFieldSetTest.java | 70 ByteString getBizarroData() throws Exception { in getBizarroData() 94 ByteString allFieldsData; 153 ByteString data = emptyMessage.toByteString(); in testSerialize() 227 ByteString data = fields.toByteString(); in testParseKnownAndUnknown() 243 ByteString bizarroData = getBizarroData(); in testWrongTypeTreatedAsUnknown() 268 ByteString bizarroData = getBizarroData(); in testWrongExtensionTypeTreatedAsUnknown() 287 ByteString data = in testParseUnknownEnumValue() 341 ByteString data = in testLargeVarint() 370 .addLengthDelimited(ByteString.EMPTY) in testEqualsAndHashCode() 454 ByteString data = emptyMessageLite.toByteString(); in testSerializeLite() [all …]
|
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/spdy/ |
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/okhttp/okhttp-ws-tests/src/test/java/com/squareup/okhttp/internal/ws/ |
D | WebSocketReaderTest.java | 26 import okio.ByteString; 50 data.write(ByteString.decodeHex("0a00")); // Empty ping. in controlFramesMustBeFinal() 60 data.write(ByteString.decodeHex("9a00")); // Empty ping, flag 1 set. in reservedFlagsAreUnsupported() 68 data.write(ByteString.decodeHex("aa00")); // Empty ping, flag 2 set. in reservedFlagsAreUnsupported() 76 data.write(ByteString.decodeHex("ca00")); // Empty ping, flag 3 set. in reservedFlagsAreUnsupported() 86 data.write(ByteString.decodeHex("8100")); in clientSentFramesMustBeMasked() 96 data.write(ByteString.decodeHex("8180")); in serverSentFramesMustNotBeMasked() 106 data.write(ByteString.decodeHex("8a7e007e")); in controlFramePayloadMax() 116 data.write(ByteString.decodeHex("810548656c6c6f")); // Hello in clientSimpleHello() 122 data.write(ByteString.decodeHex("818537fa213d7f9f4d5158")); // Hello in serverSimpleHello() [all …]
|
/external/protobuf/java/src/main/java/com/google/protobuf/ |
D | ByteString.java | 60 public abstract class ByteString implements Iterable<Byte> { class 81 public static final ByteString EMPTY = new LiteralByteString(new byte[0]); 84 ByteString() {} in ByteString() method in ByteString 150 public ByteString substring(int beginIndex) { in substring() 164 public abstract ByteString substring(int beginIndex, int endIndex); in substring() 175 public boolean startsWith(ByteString prefix) { in startsWith() 189 public boolean endsWith(ByteString suffix) { in endsWith() 205 public static ByteString copyFrom(byte[] bytes, int offset, int size) { in copyFrom() 217 public static ByteString copyFrom(byte[] bytes) { in copyFrom() 229 public static ByteString copyFrom(ByteBuffer bytes, int size) { in copyFrom() [all …]
|
D | LazyStringArrayList.java | 91 } else if (o instanceof ByteString) { in get() 92 ByteString bs = (ByteString) o; in get() 146 public boolean addAllByteString(Collection<? extends ByteString> values) { in addAllByteString() 173 public void add(ByteString element) { in add() 185 public ByteString getByteString(int index) { in getByteString() 187 ByteString b = asByteString(o); in getByteString() 205 public void set(int index, ByteString s) { in set() 218 } else if (o instanceof ByteString) { in asString() 219 return ((ByteString) o).toStringUtf8(); in asString() 225 private static ByteString asByteString(Object o) { in asByteString() [all …]
|
D | RopeByteString.java | 70 class RopeByteString extends ByteString { 115 private final ByteString left; 116 private final ByteString right; 129 private RopeByteString(ByteString left, ByteString right) { in RopeByteString() 151 static ByteString concatenate(ByteString left, ByteString right) { in concatenate() 152 ByteString result; in concatenate() 161 if (newLength < ByteString.CONCATENATE_BY_COPY_SIZE) { in concatenate() 177 ByteString newRight = concatenateBytes(leftRope.right, right); in concatenate() 187 ByteString newRight = new RopeByteString(leftRope.right, right); in concatenate() 212 private static LiteralByteString concatenateBytes(ByteString left, in concatenateBytes() [all …]
|
/external/okhttp/okio/okio/src/main/java/okio/ |
D | ByteString.java | 44 public class ByteString implements Serializable { class 50 public static final ByteString EMPTY = ByteString.of(); 56 ByteString(byte[] data) { in ByteString() method in ByteString 63 public static ByteString of(byte... data) { in of() 65 return new ByteString(data.clone()); in of() 72 public static ByteString of(byte[] data, int offset, int byteCount) { in of() 78 return new ByteString(copy); in of() 82 public static ByteString encodeUtf8(String s) { in encodeUtf8() 84 ByteString byteString = new ByteString(s.getBytes(Util.UTF_8)); in encodeUtf8() 106 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/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/http/ |
D | SpdyTransport.java | 37 import okio.ByteString; 51 private static final List<ByteString> SPDY_3_PROHIBITED_HEADERS = Util.immutableList( 52 ByteString.encodeUtf8("connection"), 53 ByteString.encodeUtf8("host"), 54 ByteString.encodeUtf8("keep-alive"), 55 ByteString.encodeUtf8("proxy-connection"), 56 ByteString.encodeUtf8("transfer-encoding")); 59 private static final List<ByteString> HTTP_2_PROHIBITED_HEADERS = Util.immutableList( 60 ByteString.encodeUtf8("connection"), 61 ByteString.encodeUtf8("host"), [all …]
|
/external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ |
D | CertificatePinner.java | 27 import okio.ByteString; 114 private final Map<String, List<ByteString>> hostnameToPins; 131 List<ByteString> pins = hostnameToPins.get(hostname); in check() 150 ByteString pin = pins.get(i); in check() 174 private static ByteString sha1(X509Certificate x509Certificate) { in sha1() 175 return Util.sha1(ByteString.of(x509Certificate.getPublicKey().getEncoded())); in sha1() 180 private final Map<String, List<ByteString>> hostnameToPins = new LinkedHashMap<>(); 190 List<ByteString> hostPins = new ArrayList<>(); in add() 191 List<ByteString> previousPins = hostnameToPins.put(hostname, unmodifiableList(hostPins)); in add() 200 ByteString decodedPin = ByteString.decodeBase64(pin.substring("sha1/".length())); in add()
|