ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/util/buf/TestCharChunkLargeHeap.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/test/org/apache/tomcat/util/buf/TestCharChunkLargeHeap.java
Status
scanned
Type
file
Name
TestCharChunkLargeHeap.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
1751 (1.7 KB)
MD5
fe359a7e1b474cedc0f5480e1985d20c
SHA1
b7559e1c9d46d2d98e69177c9bd1b9f8e2946892
SHA256
d98ff329bdad5c94b68b269da26b852c49d80380897ebda05f4e7ccbd7a73ba9
SHA512

      
    
SHA1_git
bd5e8796505308f4a7628c0da52aeaebdcebdecd
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
TestCharChunkLargeHeap.java | 1.7 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomcat.util.buf; import java.io.IOException; import org.junit.Assert; import org.junit.Test; import org.apache.tomcat.util.buf.CharChunk.CharOutputChannel; /** * Test cases for {@link CharChunk}. */ public class TestCharChunkLargeHeap { @Test public void testAppend() throws Exception { CharChunk cc = new CharChunk(); cc.setCharOutputChannel(new Sink()); // Defaults to no limit char data[] = new char[32 * 1024 * 1024]; for (int i = 0; i < 100; i++) { cc.append(data, 0, data.length); } Assert.assertEquals(AbstractChunk.ARRAY_MAX_SIZE, cc.getBuffer().length); } public static class Sink implements CharOutputChannel { @Override public void realWriteChars(char[] cbuf, int off, int len) throws IOException { // NO-OP } } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
54.59
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9