< prev index next >
src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/HeaderFrame.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 23,56 ****
* questions.
*/
package jdk.incubator.http.internal.frame;
- import jdk.incubator.http.internal.common.ByteBufferReference;
import jdk.incubator.http.internal.common.Utils;
import java.nio.ByteBuffer;
/**
* Either a HeadersFrame or a ContinuationFrame
*/
public abstract class HeaderFrame extends Http2Frame {
final int headerLength;
! final ByteBufferReference[] headerBlocks;
public static final int END_STREAM = 0x1;
public static final int END_HEADERS = 0x4;
! public HeaderFrame(int streamid, int flags, ByteBufferReference headerBlock) {
! this(streamid, flags, new ByteBufferReference[]{headerBlock});
! }
!
! public HeaderFrame(int streamid, int flags, ByteBufferReference[] headerBlocks) {
super(streamid, flags);
this.headerBlocks = headerBlocks;
! this.headerLength = Utils.remaining(headerBlocks);
}
@Override
public String flagAsString(int flag) {
switch (flag) {
--- 23,52 ----
* questions.
*/
package jdk.incubator.http.internal.frame;
import jdk.incubator.http.internal.common.Utils;
import java.nio.ByteBuffer;
+ import java.util.List;
/**
* Either a HeadersFrame or a ContinuationFrame
*/
public abstract class HeaderFrame extends Http2Frame {
final int headerLength;
! final List<ByteBuffer> headerBlocks;
public static final int END_STREAM = 0x1;
public static final int END_HEADERS = 0x4;
! public HeaderFrame(int streamid, int flags, List<ByteBuffer> headerBlocks) {
super(streamid, flags);
this.headerBlocks = headerBlocks;
! this.headerLength = Utils.remaining(headerBlocks, Integer.MAX_VALUE);
}
@Override
public String flagAsString(int flag) {
switch (flag) {
*** 61,71 ****
}
return super.flagAsString(flag);
}
! public ByteBufferReference[] getHeaderBlock() {
return headerBlocks;
}
int getHeaderLength() {
return headerLength;
--- 57,67 ----
}
return super.flagAsString(flag);
}
! public List<ByteBuffer> getHeaderBlock() {
return headerBlocks;
}
int getHeaderLength() {
return headerLength;
< prev index next >