mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8262403: Enhanced data transfers
Reviewed-by: rhalade, prr, vdyakov, ahgross
(cherry picked from commit 9accf7c894)
This commit is contained in:
committed by
Vitaly Provodin
parent
30364d564d
commit
bc88a4f828
@@ -25,6 +25,7 @@
|
||||
|
||||
package java.awt.datatransfer;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.Externalizable;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInput;
|
||||
@@ -321,9 +322,12 @@ MimeTypeParameterList(rawdata.substring(semIndex));
|
||||
ClassNotFoundException {
|
||||
String s = in.readUTF();
|
||||
if (s == null || s.length() == 0) { // long mime type
|
||||
byte[] ba = new byte[in.readInt()];
|
||||
in.readFully(ba);
|
||||
s = new String(ba);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
int len = in.readInt();
|
||||
while (len-- > 0) {
|
||||
baos.write(in.readByte());
|
||||
}
|
||||
s = baos.toString();
|
||||
}
|
||||
try {
|
||||
parse(s);
|
||||
|
||||
Reference in New Issue
Block a user