src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/hpack/StringWriter.java
branchhttp-client-branch
changeset 55763 634d8e14c172
parent 47216 71c04702a3d5
child 56088 38fac6d0521d
equal deleted inserted replaced
55762:e947a3a50a95 55763:634d8e14c172
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    60 
    60 
    61     StringWriter configure(CharSequence input, boolean huffman) {
    61     StringWriter configure(CharSequence input, boolean huffman) {
    62         return configure(input, 0, input.length(), huffman);
    62         return configure(input, 0, input.length(), huffman);
    63     }
    63     }
    64 
    64 
    65     StringWriter configure(CharSequence input, int start, int end,
    65     StringWriter configure(CharSequence input,
       
    66                            int start,
       
    67                            int end,
    66                            boolean huffman) {
    68                            boolean huffman) {
    67         if (start < 0 || end < 0 || end > input.length() || start > end) {
    69         if (start < 0 || end < 0 || end > input.length() || start > end) {
    68             throw new IndexOutOfBoundsException(
    70             throw new IndexOutOfBoundsException(
    69                     String.format("input.length()=%s, start=%s, end=%s",
    71                     String.format("input.length()=%s, start=%s, end=%s",
    70                             input.length(), start, end));
    72                             input.length(), start, end));