Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–96 unchanged (96 lines)
97 long skipped = input.skip(numToSkip);
98 if (skipped == 0) {
99 break;
100 }
101 numToSkip -= skipped;
102 }
103
104 return available - numToSkip;
105 }
106
107 /**
108 * Reads as much from input as possible to fill the given array.
109 *
…lines 110–193 unchanged (84 lines)

After

…lines 1–97 unchanged (97 lines)
98 if (skipped == 0) {
99 break;
100 }
101 numToSkip -= skipped;
102 }
103
104 if (numToSkip > 0) {
105 byte[] skipBuf = new byte[SKIP_BUF_SIZE];
106 while (numToSkip > 0) {
107 int read = readFully(input, skipBuf, 0,
108 (int) Math.min(numToSkip, SKIP_BUF_SIZE));
109 if (read < 1) {
110 break;
111 }
112 numToSkip -= read;
113 }
114 }
115 return available - numToSkip;
116 }
117
118 /**
119 * Reads as much from input as possible to fill the given array.
120 *
…lines 121–204 unchanged (84 lines)

Before

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "utils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ByteArrayOutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Closeable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "OutputStream"
; ";"
block_comment "/**\n * Utility functions\n * @Immutable\n */"
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "IOUtils"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "COPY_BUF_SIZE"
= "="
decimal_integer_literal "8024"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "SKIP_BUF_SIZE"
= "="
decimal_integer_literal "4096"
; ";"
block_comment "/** Private constructor to prevent instantiation of this uti"...
constructor_declaration
modifiers
private "private"
identifier "IOUtils"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
} "}"
block_comment "/**\n * Copies the content of a InputStream into an Outpu"...
method_declaration (+40 nodes collapsed)
block_comment "/**\n * Copies the content of a InputStream into an Outpu"...
method_declaration (+120 nodes collapsed)
block_comment "/**\n * Skips the given number of bytes by repeatedly inv"...
method_declaration
modifiers
public "public"
static "static"
integral_type
long "long"
identifier "skip"
formal_parameters
( "("
formal_parameter
type_identifier "InputStream"
identifier "input"
, ","
formal_parameter
integral_type
long "long"
identifier "numToSkip"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
local_variable_declaration
integral_type
long "long"
variable_declarator
identifier "available"
= "="
identifier "numToSkip"
; ";"
while_statement (+48 nodes collapsed)
return_statement
return "return"
binary_expression
identifier "available"
- "-"
identifier "numToSkip"
; ";"
} "}"
block_comment "/**\n * Reads as much from input as possible to fill the "...
method_declaration (+46 nodes collapsed)
block_comment "/**\n * Reads as much from input as possible to fill the "...
method_declaration (+152 nodes collapsed)
line_comment "// toByteArray(InputStream) copied from:"
line_comment "// commons/proper/io/trunk/src/main/java/org/apache/commons/"...
line_comment "// January 8th, 2013"
line_comment "//"
line_comment "// Assuming our copy() works just as well as theirs! :-)"
block_comment "/**\n * Gets the contents of an <code>InputStream</code> "...
method_declaration (+59 nodes collapsed)
block_comment "/**\n * Closes the given Closeable and swallows any IOExc"...
method_declaration (+53 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) under"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "utils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ByteArrayOutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "Closeable"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "OutputStream"
; ";"
block_comment "/**\n * Utility functions\n * @Immutable\n */"
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "IOUtils"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "COPY_BUF_SIZE"
= "="
decimal_integer_literal "8024"
; ";"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "SKIP_BUF_SIZE"
= "="
decimal_integer_literal "4096"
; ";"
block_comment "/** Private constructor to prevent instantiation of this uti"...
constructor_declaration
modifiers
private "private"
identifier "IOUtils"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
} "}"
block_comment "/**\n * Copies the content of a InputStream into an Outpu"...
method_declaration (+40 nodes collapsed)
block_comment "/**\n * Copies the content of a InputStream into an Outpu"...
method_declaration (+120 nodes collapsed)
block_comment "/**\n * Skips the given number of bytes by repeatedly inv"...
method_declaration
modifiers
public "public"
static "static"
integral_type
long "long"
identifier "skip"
formal_parameters
( "("
formal_parameter
type_identifier "InputStream"
identifier "input"
, ","
formal_parameter
integral_type
long "long"
identifier "numToSkip"
) ")"
throws
throws "throws"
type_identifier "IOException"
block
{ "{"
local_variable_declaration
integral_type
long "long"
variable_declarator
identifier "available"
= "="
identifier "numToSkip"
; ";"
while_statement (+48 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "numToSkip"
> ">"
decimal_integer_literal "0"
) ")"
block
{ "{"
local_variable_declaration
array_type
integral_type
byte "byte"
dimensions
[ "["
] "]"
variable_declarator
identifier "skipBuf"
= "="
array_creation_expression
new "new"
integral_type
byte "byte"
dimensions_expr
[ "["
identifier "SKIP_BUF_SIZE"
] "]"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
identifier "numToSkip"
> ">"
decimal_integer_literal "0"
) ")"
block
{ "{"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "read"
= "="
method_invocation
identifier "readFully"
argument_list
( "("
identifier "input"
, ","
identifier "skipBuf"
, ","
decimal_integer_literal "0"
, ","
cast_expression
( "("
integral_type
int "int"
) ")"
method_invocation
identifier "Math"
. "."
identifier "min"
argument_list
( "("
identifier "numToSkip"
, ","
identifier "SKIP_BUF_SIZE"
) ")"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "read"
< "<"
decimal_integer_literal "1"
) ")"
block
{ "{"
break_statement
break "break"
; ";"
} "}"
expression_statement
assignment_expression
identifier "numToSkip"
-= "-="
identifier "read"
; ";"
} "}"
} "}"
return_statement
return "return"
binary_expression
identifier "available"
- "-"
identifier "numToSkip"
; ";"
} "}"
block_comment "/**\n * Reads as much from input as possible to fill the "...
method_declaration (+46 nodes collapsed)
block_comment "/**\n * Reads as much from input as possible to fill the "...
method_declaration (+152 nodes collapsed)
line_comment "// toByteArray(InputStream) copied from:"
line_comment "// commons/proper/io/trunk/src/main/java/org/apache/commons/"...
line_comment "// January 8th, 2013"
line_comment "//"
line_comment "// Assuming our copy() works just as well as theirs! :-)"
block_comment "/**\n * Gets the contents of an <code>InputStream</code> "...
method_declaration (+59 nodes collapsed)
block_comment "/**\n * Closes the given Closeable and swallows any IOExc"...
method_declaration (+53 nodes collapsed)
} "}"