mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8262403: Enhanced data transfers
Reviewed-by: rhalade, prr, vdyakov, ahgross
This commit is contained in:
parent
ef9315bead
commit
9accf7c894
1 changed files with 7 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue